<html>
 <head>
  <meta charset="utf-8"/>
  <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport"/>
  <title>
   QiuYixuan: 用R软件绘制中国分省市地图  | 数螺 | NAUT IDEA
  </title>
  <link href="http://cdn.bootcss.com/bootstrap/3.3.6/css/bootstrap-theme.min.css" rel="stylesheet"/>
  <link href="http://cdn.bootcss.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"/>
  <style type="text/css">
   #xmain img {
                  max-width: 100%;
                  display: block;
                  margin-top: 10px;
                  margin-bottom: 10px;
                }

                #xmain p {
                    line-height:150%;
                    font-size: 16px;
                    margin-top: 20px;
                }

                #xmain h2 {
                    font-size: 24px;
                }

                #xmain h3 {
                    font-size: 20px;
                }

                #xmain h4 {
                    font-size: 18px;
                }


                .header {
	           background-color: #0099ff;
	           color: #ffffff;
	           margin-bottom: 20px;
	        }

	        .header p {
                  margin: 0px;
                  padding: 10px 0;
                  display: inline-block;  
                  vertical-align: middle;
                  font-size: 16px;
               }

               .header a {
                 color: white;
               }

              .header img {
                 height: 25px;
              }
  </style>
  <script src="http://cdn.bootcss.com/jquery/3.0.0/jquery.min.js">
  </script>
  <script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript">
   MathJax.Hub.Config({
          tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]},
          TeX: {equationNumbers: {autoNumber: "AMS"}}
        });
  </script>
  <script src="http://nautstatic-10007657.file.myqcloud.com/static/css/readability.min.js" type="text/javascript">
  </script>
  <script type="text/javascript">
   $(document).ready(function() {
                 var loc = document.location;
                 var uri = {
                  spec: "http://cos.name/2009/07/drawing-china-map-using-r/",
                  host: "http://cos.name",
                  prePath: "http://cos.name",
                  scheme: "http",
                  pathBase: "http://cos.name/"
                 };
    
                 var documentClone = document.cloneNode(true);
                 var article = new Readability(uri, documentClone).parse();
     
                 document.getElementById("xmain").innerHTML = article.content;
                });
  </script>
  <!-- 1466463784: Accept with keywords: (title(0.125):省市,门户网站,地图,统计学,服务平台,中国,软件,绘制, topn(0.2):乱码,统计学,英文,分割线,目录,文件,重庆市,颜色,参数,文章,中国,可视化,北京市,省份,省市,多边形,函数,数据,省名,运算符,天津市,你好,问题,错误,绘制,代码,地图,图例,内容,软件).-->
 </head>
 <body class="single single-post postid-1335 single-format-standard sidebar" onload="">
  <div class="header">
   <div class="container">
    <div class="row">
     <div class="col-xs-6 col-sm-6 text-left">
      <a href="/databee">
       <img src="http://nautidea-10007657.cos.myqcloud.com/logo_white.png"/>
      </a>
      <a href="/databee">
       <p>
        数螺
       </p>
      </a>
     </div>
     <div class="hidden-xs col-sm-6 text-right">
      <p>
       致力于数据科学的推广和知识传播
      </p>
     </div>
    </div>
   </div>
  </div>
  <div class="container text-center">
   <h1>
    QiuYixuan: 用R软件绘制中国分省市地图
   </h1>
  </div>
  <div class="container" id="xmain">
   <div class="hfeed site" id="page">
    <header class="site-header" id="masthead" role="banner">
     <div id="cos-logo">
      <a href="http://cos.name/">
       <img src="http://cos.name/wp-content/themes/COS-kermesinus/images/headers/cos-logo.png"/>
      </a>
     </div>
     <div class="navbar" id="navbar">
      <nav class="navigation main-navigation" id="site-navigation" role="navigation">
       <h3 class="menu-toggle">
        菜单
       </h3>
       <a class="screen-reader-text skip-link" href="http://cos.name/2009/07/drawing-china-map-using-r/#content" title="跳至内容">
        跳至内容
       </a>
       <div class="menu-%e6%88%91%e7%9a%84%e8%8f%9c%e5%8d%95-container">
        <ul class="nav-menu" id="menu-%e6%88%91%e7%9a%84%e8%8f%9c%e5%8d%95">
         <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-home menu-item-4746" id="menu-item-4746">
          <a href="http://cos.name">
           主页
          </a>
         </li>
         <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-has-children menu-item-8120" id="menu-item-8120">
          <a href="http://cos.name/cn">
           论坛
          </a>
          <ul class="sub-menu">
           <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-8124" id="menu-item-8124">
            <a href="http://cos.name/cn/wp-login.php?action=register">
             论坛注册
            </a>
           </li>
           <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-8125" id="menu-item-8125">
            <a href="http://cos.name/cn/wp-login.php">
             论坛登录
            </a>
           </li>
          </ul>
         </li>
         <li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-8110" id="menu-item-8110">
          <a href="http://cos.name/books/">
           图书资料
          </a>
         </li>
         <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-8112" id="menu-item-8112">
          <a href="http://cos.name/videos">
           视频教程
          </a>
         </li>
         <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-8333" id="menu-item-8333">
          <a href="http://cos.name/salon/">
           统计沙龙
          </a>
         </li>
         <li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-8111" id="menu-item-8111">
          <a href="http://cos.name/chinar/">
           R语言会议
          </a>
         </li>
         <li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-8109" id="menu-item-8109">
          <a href="http://cos.name/training/">
           讲座与培训
          </a>
         </li>
         <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-8115" id="menu-item-8115">
          <a href="http://cos.name/cn/forum/comprehensive/job/">
           招聘信息
          </a>
         </li>
         <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-has-children menu-item-4780" id="menu-item-4780">
          <a href="http://cos.name/about">
           关于我们
          </a>
          <ul class="sub-menu">
           <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-8113" id="menu-item-8113">
            <a href="http://cos.name/2008/11/how-to-work-with-cos/">
             加入我们
            </a>
           </li>
           <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-8119" id="menu-item-8119">
            <a href="http://cos.name/donate/">
             赞助我们
            </a>
           </li>
           <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-8114" id="menu-item-8114">
            <a href="http://cos.name/cn/forum/26">
             项目合作
            </a>
           </li>
          </ul>
         </li>
        </ul>
       </div>
       <form action="http://cos.name/" class="search-form" method="get" role="search">
        <label>
         <span class="screen-reader-text">
          搜索：
         </span>
        </label>
       </form>
      </nav>
      <!-- #site-navigation -->
     </div>
     <!-- #navbar -->
    </header>
    <!-- #masthead -->
    <div class="site-main" id="main">
     <div class="content-area" id="primary">
      <div class="site-content" id="content" role="main">
       <article class="post-1335 post type-post status-publish format-standard hentry category-featured category-website category-packages tag-gis tag-r tag-265" id="post-1335">
        <header class="entry-header">
         <h1 class="entry-title">
          用R软件绘制中国分省市地图
         </h1>
         <div class="entry-meta">
          <span class="date">
           <a href="http://cos.name/2009/07/drawing-china-map-using-r/" rel="bookmark" title="链向用R软件绘制中国分省市地图的固定链接">
            <time class="entry-date" datetime="2009-07-02T13:25:03+00:00">
             2009/07/02
            </time>
           </a>
          </span>
          <span class="categories-links">
           <a href="http://cos.name/category/website/featured/" rel="category tag">
            推荐文章
           </a>
           、
           <a href="http://cos.name/category/website/" rel="category tag">
            统计之都
           </a>
           、
           <a href="http://cos.name/category/software/packages/" rel="category tag">
            统计软件
           </a>
          </span>
          <span class="tags-links">
           <a href="http://cos.name/tag/gis%e6%95%b0%e6%8d%ae/" rel="tag">
            GIS数据
           </a>
           、
           <a href="http://cos.name/tag/r%e8%bd%af%e4%bb%b6/" rel="tag">
            R软件
           </a>
           、
           <a href="http://cos.name/tag/%e4%b8%ad%e5%9b%bd%e5%9c%b0%e5%9b%be/" rel="tag">
            中国地图
           </a>
          </span>
          <span class="author vcard">
           <a class="url fn n" href="http://cos.name/author/yixuanq/" rel="author" title="查看所有由邱怡轩发布的文章">
            邱怡轩
           </a>
          </span>
         </div>
         <!-- .entry-meta -->
        </header>
        <!-- .entry-header -->
        <div class="entry-content">
         <p>
          <span style="color: #ff0000;">
           【注】新版本的
           <code>
            maptools
           </code>
           包对很多函数进行了修改，对于修改的内容，文章中用红色的文字进行了说明。
          </span>
         </p>
         <p>
          鉴于最近有不少人在讨论用R软件绘制地图的问题，我也就跟着凑了凑热闹，对相应的方法学习了一番。下面的这篇文章是一个初步的介绍，还有很多内容仍在学习和探索中，如果大家有什么意见或建议，我将根据自己学习的情况对文章进行进一步的补充。
         </p>
         <p>
          在R中绘制地图其实是十分方便的，最直接的办法大概就是安装
          <code>
           maps
          </code>
          和
          <code>
           mapdata
          </code>
          这两个包，然后输入下面的命令：
         </p>
         <pre class="brush: r">library(maps)
library(mapdata)
map("china")</pre>
         <p>
          其中
          <code>
           map()
          </code>
          函数还可以加上很多参数，在这里就不一一详述，具体的用法只需问号之。然而仔细看一看这张地图你会发现重庆市和四川省仍然是浑然一体，可见该地图的数据应该是有些年头了。
          <span id="more-1335">
          </span>
         </p>
         <p>
          幸运的是，通过
          <a href="http://yihui.name/cn/2007/09/china-map-at-province-level/" title="终于搞定了中国分省市地图">
           谢益辉的这篇博文
          </a>
          我们已经可以大体知道该如何操作了，下面就为大家介绍一下具体的步骤。
         </p>
         <p>
          首先，从
          <a href="http://cos.name/wp-content/uploads/2009/07/chinaprovinceborderdata_tar_gz.zip">
           这里
          </a>
          下载中国地图的GIS数据，这是一个压缩包，完全解压后包含三个文件（bou2_4p.dbf、bou2_4p.shp和bou2_4p.shx），将这三个文件解压到同一个目录下，并在R中设好相应的工作空间，然后安装
          <code>
           maptools
          </code>
          包，运行如下程序：
         </p>
         <pre class="brush: r">library(maptools);
x=read.shape('bou2_4p.shp');#下文中会继续用到x这个变量，
                            #如果你用的是其它的名称，
                            #请在下文的程序中也进行相应的改动。
plot(x);</pre>
         <p>
          <span style="color: #ff0000;">
           【修改】新版本的maptools包不再提供read.shape()函数，请用readShapePoly()代替。
          </span>
         </p>
         <p>
          这时一张完整的中国地图就已经画好了。但是在实际使用的过程中，我们往往会根据自己的需要对地图中的某些省份着以特定的颜色，这时就可以通过调节
          <code>
           plot
          </code>
          命令中的
          <code>
           fg
          </code>
          参数来予以实现。然而为了清楚地说明这部分的内容，我需要插播一段R绘制地图的原理。
         </p>
         <p style="text-align: center;">
          ======================传说中的分割线=====================
         </p>
         <p>
          在绘制地图时，每一个省市自治区或者岛屿都是用一个多边形来表示的。之前的GIS数据，其实就是提供了每一个行政区其多边形逐点的坐标，然后R软件通过顺次连接这些坐标，就绘制出了一个多边形区域。在上面的数据中，一共包含了925个多边形的信息，之所以有这么多是因为一些省份有很多小的附属岛屿。在这925个多边形中，每一个都对应一个唯一的ID，编号分别从1到925。
         </p>
         <p style="text-align: center;">
          ======================传说中的分割线=====================
         </p>
         <p>
          回到刚才的话题，
          <code>
           plot
          </code>
          命令中的
          <code>
           fg
          </code>
          参数在本例中应该是一个长度为925的向量，其第i个分量的取值就代表了地图中第i个多边形的颜色。一个简单的尝试是运行下面这个命令看看效果：
         </p>
         <pre class="brush: r">plot(x,fg=gray(924:0/924));</pre>
         <p>
          <span style="color: #ff0000;">
           【修改】新版本的
           <code>
            maptools
           </code>
           包的绘图参数也有所改变，请将
           <code>
            fg
           </code>
           换成
           <code>
            col
           </code>
           。
          </span>
         </p>
         <p>
          于是自然就产生了一个问题：如何获取某一个特定地区的ID，进而设置我们想要的颜色？事实上，在变量x中，就已经存储了我们想要的信息。在R中输入“
          <code>
           x[[2]]
          </code>
          ”或“
          <code>
           x$att.data
          </code>
          ”，会得到一个925行7列的数据框，这其实是bou2_4p.dbf这个文件中存储的信息，之前的
          <code>
           read.shape()
          </code>
          函数虽然读取的是bou2_4p.shp文件，但在默认情况下会把dbf文件的信息也放到变量之中。对于这个数据框，其行名就是每一个区域的ID编号，第一列和第二列分别是面积和周长，最后一列是该区域所属的行政区名，其它的列应该也是一些编号性质的变量。于是，通过查找相应的行政区对应的行名，就可以对
          <code>
           fg
          </code>
          参数进行赋值了。下面是我编的一个函数，用来生成所需的
          <code>
           fg
          </code>
          向量：
         </p>
         <pre class="brush: r">getColor=function(mapdata,provname,provcol,othercol)
{
	f=function(x,y) ifelse(x %in% y,which(y==x),0);
	colIndex=sapply(mapdata$att.data$NAME,f,provname);
	fg=c(othercol,provcol)[colIndex+1];
	return(fg);
}</pre>
         <p>
          <span style="color: #ff0000;">
           【修改】地图数据的组织形式有所变化，上面函数中的
           <code>
            mapdata$att.data$NAME
           </code>
           需要替换为
           <code>
            mapdata@data$NAME
           </code>
           。
          </span>
         </p>
         <p>
          其中
          <code>
           mapdata
          </code>
          是存放地图数据的变量，在上面的例子中就是x，
          <code>
           provname
          </code>
          是需要改变颜色的地区的名称，
          <code>
           provcol
          </code>
          是对应于
          <code>
           provname
          </code>
          的代表颜色的向量（名称和数字均可），
          <code>
           othercol
          </code>
          是其它地区的颜色。举例如下：
         </p>
         <pre class="brush: r">provname=c("北京市","天津市","上海市","重庆市");
provcol=c("red","green","yellow","purple");
plot(x,fg=getColor(x,provname,provcol,"white"));</pre>
         <p>
          <img src="http://cos.name/wp-content/uploads/2009/07/map00-e1262748931991.png"/>
         </p>
         <p>
          注意
          <code>
           provname
          </code>
          一定要写地区的全称，写法可以参照下面这条命令生成的向量：
         </p>
         <pre class="brush: r">as.character(na.omit(unique(x$att.data$NAME)));</pre>
         <p>
          由此生成的向量有33个元素，少了澳门特别行政区，这是这个数据中的一块瑕疵。在
          <code>
           x$att.data
          </code>
          的第899行有一个
          <code>
           NA
          </code>
          ，不知道它代表的是否就是澳门。
         </p>
         <p>
          利用类似的方法就可以根据自己的需要对不同的区域进行着色，下面再举一例。从国家统计局获取2007年我国各地区的人口数据，然后根据人口的多少对各省份进行着色。程序如下：
         </p>
         <pre class="brush: r">provname=c("北京市","天津市","河北省","山西省","内蒙古自治区",
		"辽宁省","吉林省","黑龙江省","上海市","江苏省",
		"浙江省","安徽省","福建省","江西省","山东省",
		"河南省","湖北省","湖南省","广东省",
		"广西壮族自治区","海南省","重庆市","四川省","贵州省",
		"云南省","西藏自治区","陕西省","甘肃省","青海省",
		"宁夏回族自治区","新疆维吾尔自治区","台湾省",
		"香港特别行政区");
pop=c(1633,1115,6943,3393,2405,4298,2730,3824,1858,7625,
		5060,6118,3581,4368,9367,9360,5699,6355,9449,
		4768,845,2816,8127,3762,4514,284,3748,2617,
		552,610,2095,2296,693);
provcol=rgb(red=1-pop/max(pop)/2,green=1-pop/max(pop)/2,blue=0);
plot(x,fg=getColor(x,provname,provcol,"white"),xlab="",ylab="");</pre>
         <p style="text-align: center;">
          <a href="http://cos.name/wp-content/uploads/2009/07/map01.png">
           <img src="http://cos.name/wp-content/uploads/2009/07/map01-e1262748729327.png"/>
          </a>
         </p>
         <p>
          其中颜色越深的地方代表人口数越多，反之为人口数越少。
         </p>
         <p>
          此外，在绘制地图的过程中，还有一个比较有用的参数是
          <code>
           recs
          </code>
          ，它是一个由多边形ID组成的向量，表示在地图中只画出这些ID所代表的区域。利用这个参数，就可以画出某一部分的地图，例如下面的例子是我国中部六省的地图：
         </p>
         <pre class="brush: r">getID=function(mapdata,provname)
{
	index=mapdata$att.data$NAME %in% provname;
	ids=rownames(mapdata$att.data[index,]);
	return(as.numeric(ids));
}
midchina=c("河南省","山西省","湖北省","安徽省","湖南省","江西省");
plot(x,recs=getID(x,midchina),fg="green",ol="white",xlab="",
		ylab="");</pre>
         <p>
          <img src="http://cos.name/wp-content/uploads/2009/07/map02-e1262748890424.png"/>
          <br/>
          上面的
          <code>
           getID()
          </code>
          是我编写的一个功能与
          <code>
           getColor()
          </code>
          类似的函数，用来返回指定省份的ID。
         </p>
         <p>
          <span style="color: #ff0000;">
           【修改】新版本的
           <code>
            maptools
           </code>
           包的绘图函数已经取消了
           <code>
            recs
           </code>
           这个参数，现在要实现这个功能，可以在颜色上把不需要的省份变成白色，其中填充色用
           <code>
            col
           </code>
           参数，边界颜色用
           <code>
            border
           </code>
           参数。例如上面的例子可以用下面的函数来实现：
          </span>
         </p>
         <pre class="brush: r">plot(x, col = getColor(x, midchina, rep("green", 6),
    "white"), border = "white", xlab = "", ylab = "")</pre>
         <p>
          最后要说的是，在画出的图上仍然可以用
          <code>
           points()
          </code>
          函数和
          <code>
           text()
          </code>
          函数加上点和文字，而
          <code>
           maptools
          </code>
          包中还提供了一个
          <code>
           pointLabel()
          </code>
          函数，用来解决文本标签的重叠问题。这部分内容请参阅博文：
          <a href="http://yihui.name/cn/2008/10/china-map-and-city-locations-with-r/">
           用R画中国地图并标注城市位置
          </a>
          ，以及
          <a href="http://yihui.name/cn/2008/10/avoid-label-overlap-pointlabel-in-maptools/">
           避免文本标签重叠：maptools中的pointLabel()
          </a>
          。
         </p>
         <p>
          从以上的内容来看，本文所述的都是一些最基本的绘图方法，还没有对地理信息数据进行更进一步的分析。如果有机会的话，这一主题的下一篇文章将为大家介绍地图数据的组成结构，并说明如何将不同格式的地理数据整合起来，例如如何在上面的地图上绘制出我国的铁路、水系分布等内容。
         </p>
         <div class="wumii-hook">
          <br/>
          <br/>
         </div>
        </div>
        <!-- .entry-content -->
        <footer class="entry-meta">
         <div class="author-info">
          <div class="author-avatar">
           <img src="http://sdn.geekzu.org/avatar/f09663fd5fc04bad5e5b09daddb86fe6?s=74&amp;d=monsterid&amp;r=g"/>
          </div>
          <!-- .author-avatar -->
          <div class="author-description">
           <h2 class="author-title">
            关于邱怡轩
           </h2>
           <p class="author-bio">
            中国人民大学统计学院硕士，普渡（
            <del>
             众生
            </del>
            ）大学博士研究僧
            <a class="author-link" href="http://cos.name/author/yixuanq/" rel="author">
             查看所有由邱怡轩发表的文章
             <span class="meta-nav">
              →
             </span>
            </a>
           </p>
          </div>
          <!-- .author-description -->
         </div>
         <!-- .author-info -->
        </footer>
        <!-- .entry-meta -->
       </article>
       <!-- #post -->
       <nav class="navigation post-navigation" role="navigation">
        <h1 class="screen-reader-text">
         文章导航
        </h1>
        <div class="nav-links">
         <a href="http://cos.name/2009/06/statistical-analysis-and-winbugs-part-4/" rel="prev">
          <span class="meta-nav">
           ←
          </span>
          WinBUGS在统计分析中的应用（第四部分）
         </a>
         <a href="http://cos.name/2009/07/studying-notes-on-oop-in-r/" rel="next">
          R中面向对象编程方法
          <span class="meta-nav">
           →
          </span>
         </a>
        </div>
        <!-- .nav-links -->
       </nav>
       <!-- .navigation -->
       <div class="comments-area" id="comments">
        <h2 class="comments-title">
         《
         <span>
          用R软件绘制中国分省市地图
         </span>
         》有173个想法
        </h2>
        <ol class="comment-list">
         <li class="comment byuser comment-author-taiyun even thread-even depth-1 parent" id="comment-740">
          <article class="comment-body" id="div-comment-740">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/beb15ba775be6241a4e5fc9e476e36c0?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              <a class="url" href="http://hi.baidu.com/cloud_wei" rel="external nofollow">
               魏太云
              </a>
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-740">
              <time datetime="2009-07-02T23:01:46+00:00">
               2009/07/02 23:01
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             很好很强大，以前用maptools，发现里面的数据很支离破碎，无法画分省图。
            </p>
            <p>
             这下可好了。
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给魏太云" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=740#respond" onclick='return addComment.moveForm( "div-comment-740", "740", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
          <ol class="children">
           <li class="comment odd alt depth-2" id="comment-1744">
            <article class="comment-body" id="div-comment-1744">
             <footer class="comment-meta">
              <div class="comment-author vcard">
               <img src="http://sdn.geekzu.org/avatar/344cc2de04baa0450028a1b0ed07aba0?s=74&amp;d=monsterid&amp;r=g"/>
               <b class="fn">
                余西亚
               </b>
               <span class="says">
                说道：
               </span>
              </div>
              <!-- .comment-author -->
              <div class="comment-metadata">
               <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-1744">
                <time datetime="2010-11-24T14:39:12+00:00">
                 2010/11/24 14:39
                </time>
               </a>
              </div>
              <!-- .comment-metadata -->
             </footer>
             <!-- .comment-meta -->
             <div class="comment-content">
              <p>
               学习一下
              </p>
             </div>
             <!-- .comment-content -->
             <div class="reply">
              <a aria-label="回复给余西亚" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=1744#respond" onclick='return addComment.moveForm( "div-comment-1744", "1744", "respond", "1335" )' rel="nofollow">
               回复
              </a>
             </div>
            </article>
            <!-- .comment-body -->
           </li>
           <!-- #comment-## -->
          </ol>
          <!-- .children -->
         </li>
         <!-- #comment-## -->
         <li class="comment even thread-odd thread-alt depth-1" id="comment-741">
          <article class="comment-body" id="div-comment-741">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/13952c5632e9c3abf2d4e6376db578e4?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              kimboo
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-741">
              <time datetime="2009-07-03T00:22:08+00:00">
               2009/07/03 00:22
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             顶了，这篇文对空间统计分析很有用哈~
             <br/>
             如果可以对地图上的距离长度信息进行提取的话那么就更完美了！
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给kimboo" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=741#respond" onclick='return addComment.moveForm( "div-comment-741", "741", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
         </li>
         <!-- #comment-## -->
         <li class="comment byuser comment-author-yixuanq bypostauthor odd alt thread-even depth-1" id="comment-742">
          <article class="comment-body" id="div-comment-742">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/f09663fd5fc04bad5e5b09daddb86fe6?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              邱怡轩
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-742">
              <time datetime="2009-07-03T00:38:11+00:00">
               2009/07/03 00:38
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             假定地球为半径为R的球体，只要知道地图上两点的坐标（经纬度），就可以算出两点之间的大圆弧长，也就是最短距离。
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给邱怡轩" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=742#respond" onclick='return addComment.moveForm( "div-comment-742", "742", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
         </li>
         <!-- #comment-## -->
         <li class="comment even thread-odd thread-alt depth-1" id="comment-743">
          <article class="comment-body" id="div-comment-743">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/6b96a772d9ef16d4cb49fe35c8f5da10?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              zwdbordeaux
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-743">
              <time datetime="2009-07-03T03:55:42+00:00">
               2009/07/03 03:55
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             太好了！我太喜欢了！！！！
             <br/>
             以前要做个报告想把中国地图放进去，然后把不同的省份运用不同的颜色表示出来简直就是一件非常让人头疼得事情。所以就扫描然后自己ps处理。可是遇到需要外文标注的时候就异常的痛苦！！所以这次总算有了解决的方案！
             <br/>
             多谢多谢！！
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给zwdbordeaux" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=743#respond" onclick='return addComment.moveForm( "div-comment-743", "743", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
         </li>
         <!-- #comment-## -->
         <li class="comment odd alt thread-even depth-1 parent" id="comment-744">
          <article class="comment-body" id="div-comment-744">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/6b96a772d9ef16d4cb49fe35c8f5da10?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              zwdbordeaux
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-744">
              <time datetime="2009-07-03T03:58:03+00:00">
               2009/07/03 03:58
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             对不起，刚才一激动，感叹号居然超过了3个，犯了谢老大的版规。自我反省一下。
            </p>
            <p>
             “再激动感叹号也不要超过三个！！”
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给zwdbordeaux" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=744#respond" onclick='return addComment.moveForm( "div-comment-744", "744", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
          <ol class="children">
           <li class="comment even depth-2" id="comment-748">
            <article class="comment-body" id="div-comment-748">
             <footer class="comment-meta">
              <div class="comment-author vcard">
               <img src="http://sdn.geekzu.org/avatar/62b5e49d0d3058fc1e5c784dd8e51727?s=74&amp;d=monsterid&amp;r=g"/>
               <b class="fn">
                jah_et
               </b>
               <span class="says">
                说道：
               </span>
              </div>
              <!-- .comment-author -->
              <div class="comment-metadata">
               <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-748">
                <time datetime="2009-07-06T10:25:18+00:00">
                 2009/07/06 10:25
                </time>
               </a>
              </div>
              <!-- .comment-metadata -->
             </footer>
             <!-- .comment-meta -->
             <div class="comment-content">
              <p>
               呵呵，这个不绝对
              </p>
             </div>
             <!-- .comment-content -->
             <div class="reply">
              <a aria-label="回复给jah_et" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=748#respond" onclick='return addComment.moveForm( "div-comment-748", "748", "respond", "1335" )' rel="nofollow">
               回复
              </a>
             </div>
            </article>
            <!-- .comment-body -->
           </li>
           <!-- #comment-## -->
          </ol>
          <!-- .children -->
         </li>
         <!-- #comment-## -->
         <li class="comment odd alt thread-odd thread-alt depth-1" id="comment-749">
          <article class="comment-body" id="div-comment-749">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/46175298662448457dcb2e8c08a95a9a?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              hunter
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-749">
              <time datetime="2009-07-06T11:36:39+00:00">
               2009/07/06 11:36
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             建议补充上澳门的数据，否则不好在学术或正式场合引用。
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给hunter" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=749#respond" onclick='return addComment.moveForm( "div-comment-749", "749", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
         </li>
         <!-- #comment-## -->
         <li class="comment even thread-even depth-1" id="comment-766">
          <article class="comment-body" id="div-comment-766">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/b6abfd1b9b9d63f6a70c8190a12a6e30?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              tianping
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-766">
              <time datetime="2009-07-13T17:21:21+00:00">
               2009/07/13 17:21
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             很好,很和谐,很强大!!!
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给tianping" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=766#respond" onclick='return addComment.moveForm( "div-comment-766", "766", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
         </li>
         <!-- #comment-## -->
         <li class="comment odd alt thread-odd thread-alt depth-1" id="comment-780">
          <article class="comment-body" id="div-comment-780">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/c6fbccb4b87d39950bb4b09a8c2aaca0?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              yzhizhi
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-780">
              <time datetime="2009-07-23T09:32:07+00:00">
               2009/07/23 09:32
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             不错不错，以前我做的时候用了很麻烦的笨方法，现在好了，语句简化但用途更强大了：）
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给yzhizhi" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=780#respond" onclick='return addComment.moveForm( "div-comment-780", "780", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
         </li>
         <!-- #comment-## -->
         <li class="comment even thread-even depth-1" id="comment-807">
          <article class="comment-body" id="div-comment-807">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/324fae90d6ffec62f1e2ba6706987274?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              Bo
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-807">
              <time datetime="2009-08-20T05:52:28+00:00">
               2009/08/20 05:52
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             导入GIS数据后，发现省名在R里显示是乱码，请问应该如何解决？ 谢谢！
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给Bo" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=807#respond" onclick='return addComment.moveForm( "div-comment-807", "807", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
         </li>
         <!-- #comment-## -->
         <li class="comment odd alt thread-odd thread-alt depth-1 parent" id="comment-844">
          <article class="comment-body" id="div-comment-844">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/6b96a772d9ef16d4cb49fe35c8f5da10?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              zwdbordeaux
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-844">
              <time datetime="2009-09-14T06:54:58+00:00">
               2009/09/14 06:54
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             我也遇到了与bo一样的问题。应该是语言设置的问题，当我读入x的时候发现：
             <br/>
             Shapefile type: Polygon, (5), # of Shapes: 925
             <br/>
             Warning message:
             <br/>
             use readShapeSpatial:
             <br/>
             objects other than Spatial objects defined in the sp package are deprecated
            </p>
            <p>
             之后也就没有办法对每个省的颜色进行改变！
             <br/>
             正在想法解决
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给zwdbordeaux" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=844#respond" onclick='return addComment.moveForm( "div-comment-844", "844", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
          <ol class="children">
           <li class="comment byuser comment-author-yixuanq bypostauthor even depth-2" id="comment-852">
            <article class="comment-body" id="div-comment-852">
             <footer class="comment-meta">
              <div class="comment-author vcard">
               <img src="http://sdn.geekzu.org/avatar/f09663fd5fc04bad5e5b09daddb86fe6?s=74&amp;d=monsterid&amp;r=g"/>
               <b class="fn">
                邱怡轩
               </b>
               <span class="says">
                说道：
               </span>
              </div>
              <!-- .comment-author -->
              <div class="comment-metadata">
               <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-852">
                <time datetime="2009-09-18T12:11:48+00:00">
                 2009/09/18 12:11
                </time>
               </a>
              </div>
              <!-- .comment-metadata -->
             </footer>
             <!-- .comment-meta -->
             <div class="comment-content">
              <p>
               R是中文的还是英文的？
              </p>
             </div>
             <!-- .comment-content -->
             <div class="reply">
              <a aria-label="回复给邱怡轩" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=852#respond" onclick='return addComment.moveForm( "div-comment-852", "852", "respond", "1335" )' rel="nofollow">
               回复
              </a>
             </div>
            </article>
            <!-- .comment-body -->
           </li>
           <!-- #comment-## -->
          </ol>
          <!-- .children -->
         </li>
         <!-- #comment-## -->
         <li class="comment odd alt thread-even depth-1" id="comment-871">
          <article class="comment-body" id="div-comment-871">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/5af435fd54bfc41c16dd1d1f9eb8bea1?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              DavidLung
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-871">
              <time datetime="2009-09-24T11:07:18+00:00">
               2009/09/24 11:07
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             没有加载到GIS数据所在的工作空间
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给DavidLung" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=871#respond" onclick='return addComment.moveForm( "div-comment-871", "871", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
         </li>
         <!-- #comment-## -->
         <li class="comment even thread-odd thread-alt depth-1 parent" id="comment-1127">
          <article class="comment-body" id="div-comment-1127">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/59682de36cfb5190042877456fba3f12?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              hgzhang
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-1127">
              <time datetime="2009-12-28T22:07:46+00:00">
               2009/12/28 22:07
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             我试着运行程序，提示
            </p>
            <p>
             &gt; x&lt;-read.shape('bou2_4p.shp');
             <br/>
             错误: 没有"read.shape"这个函数
             <br/>
             求解答，先谢了
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给hgzhang" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=1127#respond" onclick='return addComment.moveForm( "div-comment-1127", "1127", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
          <ol class="children">
           <li class="comment byuser comment-author-yixuanq bypostauthor odd alt depth-2 parent" id="comment-1128">
            <article class="comment-body" id="div-comment-1128">
             <footer class="comment-meta">
              <div class="comment-author vcard">
               <img src="http://sdn.geekzu.org/avatar/f09663fd5fc04bad5e5b09daddb86fe6?s=74&amp;d=monsterid&amp;r=g"/>
               <b class="fn">
                邱怡轩
               </b>
               <span class="says">
                说道：
               </span>
              </div>
              <!-- .comment-author -->
              <div class="comment-metadata">
               <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-1128">
                <time datetime="2009-12-28T22:17:35+00:00">
                 2009/12/28 22:17
                </time>
               </a>
              </div>
              <!-- .comment-metadata -->
             </footer>
             <!-- .comment-meta -->
             <div class="comment-content">
              <p>
               新版本的maptools包把很多原来的函数都改掉了，如果你要用的话可能得重新读一下它的帮助。
              </p>
             </div>
             <!-- .comment-content -->
             <div class="reply">
              <a aria-label="回复给邱怡轩" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=1128#respond" onclick='return addComment.moveForm( "div-comment-1128", "1128", "respond", "1335" )' rel="nofollow">
               回复
              </a>
             </div>
            </article>
            <!-- .comment-body -->
            <ol class="children">
             <li class="comment even depth-3" id="comment-1130">
              <article class="comment-body" id="div-comment-1130">
               <footer class="comment-meta">
                <div class="comment-author vcard">
                 <img src="http://sdn.geekzu.org/avatar/59682de36cfb5190042877456fba3f12?s=74&amp;d=monsterid&amp;r=g"/>
                 <b class="fn">
                  hgzhang
                 </b>
                 <span class="says">
                  说道：
                 </span>
                </div>
                <!-- .comment-author -->
                <div class="comment-metadata">
                 <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-1130">
                  <time datetime="2009-12-29T01:14:17+00:00">
                   2009/12/29 01:14
                  </time>
                 </a>
                </div>
                <!-- .comment-metadata -->
               </footer>
               <!-- .comment-meta -->
               <div class="comment-content">
                <p>
                 谢谢，修改后就没问题了
                </p>
               </div>
               <!-- .comment-content -->
              </article>
              <!-- .comment-body -->
             </li>
             <!-- #comment-## -->
             <li class="comment odd alt depth-3 parent" id="comment-1870">
              <article class="comment-body" id="div-comment-1870">
               <footer class="comment-meta">
                <div class="comment-author vcard">
                 <img src="http://sdn.geekzu.org/avatar/74ae0df5f02252fa61fa14a8c621706c?s=74&amp;d=monsterid&amp;r=g"/>
                 <b class="fn">
                  <a class="url" href="http://www.mathsoros.com" rel="external nofollow">
                   Mathsoros
                  </a>
                 </b>
                 <span class="says">
                  说道：
                 </span>
                </div>
                <!-- .comment-author -->
                <div class="comment-metadata">
                 <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-1870">
                  <time datetime="2011-01-26T10:11:10+00:00">
                   2011/01/26 10:11
                  </time>
                 </a>
                </div>
                <!-- .comment-metadata -->
               </footer>
               <!-- .comment-meta -->
               <div class="comment-content">
                <p>
                 我有一些关于R语言的问题，可以请教您吗？
                </p>
               </div>
               <!-- .comment-content -->
              </article>
              <!-- .comment-body -->
             </li>
             <!-- #comment-## -->
             <li class="comment byuser comment-author-yixuanq bypostauthor even depth-3" id="comment-1873">
              <article class="comment-body" id="div-comment-1873">
               <footer class="comment-meta">
                <div class="comment-author vcard">
                 <img src="http://sdn.geekzu.org/avatar/f09663fd5fc04bad5e5b09daddb86fe6?s=74&amp;d=monsterid&amp;r=g"/>
                 <b class="fn">
                  邱怡轩
                 </b>
                 <span class="says">
                  说道：
                 </span>
                </div>
                <!-- .comment-author -->
                <div class="comment-metadata">
                 <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-1873">
                  <time datetime="2011-01-26T21:45:30+00:00">
                   2011/01/26 21:45
                  </time>
                 </a>
                </div>
                <!-- .comment-metadata -->
               </footer>
               <!-- .comment-meta -->
               <div class="comment-content">
                <p>
                 发到论坛里大家一起讨论吧，呵呵。
                </p>
               </div>
               <!-- .comment-content -->
              </article>
              <!-- .comment-body -->
             </li>
             <!-- #comment-## -->
            </ol>
            <!-- .children -->
           </li>
           <!-- #comment-## -->
           <li class="comment byuser comment-author-yihui odd alt depth-2 parent" id="comment-1129">
            <article class="comment-body" id="div-comment-1129">
             <footer class="comment-meta">
              <div class="comment-author vcard">
               <img src="http://sdn.geekzu.org/avatar/1022d8e6ebc94e8f6bca9a86cebe312a?s=74&amp;d=monsterid&amp;r=g"/>
               <b class="fn">
                <a class="url" href="http://yihui.name" rel="external nofollow">
                 谢益辉
                </a>
               </b>
               <span class="says">
                说道：
               </span>
              </div>
              <!-- .comment-author -->
              <div class="comment-metadata">
               <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-1129">
                <time datetime="2009-12-29T00:37:08+00:00">
                 2009/12/29 00:37
                </time>
               </a>
              </div>
              <!-- .comment-metadata -->
             </footer>
             <!-- .comment-meta -->
             <div class="comment-content">
              <p>
               用
               <code>
                readShapePoly()
               </code>
               函数。如
               <code>
                x = readShapePoly('bou2_4p.shp')
               </code>
              </p>
              <p>
               邱怡轩得更新正文了。我刚看了一下，新的函数读进来的数据的子元素直接就是
               <code>
                NAME
               </code>
               那一级的，原来的
               <code>
                x$att.data$NAME
               </code>
               就是现在的
               <code>
                x$NAME
               </code>
               ，比如
               <code>
                plot(x, col = rainbow(length(levels(x$NAME)))[as.integer(x$NAME)])
               </code>
              </p>
             </div>
             <!-- .comment-content -->
             <div class="reply">
              <a aria-label="回复给谢益辉" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=1129#respond" onclick='return addComment.moveForm( "div-comment-1129", "1129", "respond", "1335" )' rel="nofollow">
               回复
              </a>
             </div>
            </article>
            <!-- .comment-body -->
            <ol class="children">
             <li class="comment even depth-3" id="comment-1151">
              <article class="comment-body" id="div-comment-1151">
               <footer class="comment-meta">
                <div class="comment-author vcard">
                 <img src="http://sdn.geekzu.org/avatar/67ff17c8c7cbaf4eeeec334f078236c9?s=74&amp;d=monsterid&amp;r=g"/>
                 <b class="fn">
                  xiaoz
                 </b>
                 <span class="says">
                  说道：
                 </span>
                </div>
                <!-- .comment-author -->
                <div class="comment-metadata">
                 <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-1151">
                  <time datetime="2010-01-05T13:18:35+00:00">
                   2010/01/05 13:18
                  </time>
                 </a>
                </div>
                <!-- .comment-metadata -->
               </footer>
               <!-- .comment-meta -->
               <div class="comment-content">
                <p>
                 哈哈。太感谢了。终于成功了。我用的是2.10.1
                </p>
               </div>
               <!-- .comment-content -->
              </article>
              <!-- .comment-body -->
             </li>
             <!-- #comment-## -->
            </ol>
            <!-- .children -->
           </li>
           <!-- #comment-## -->
          </ol>
          <!-- .children -->
         </li>
         <!-- #comment-## -->
         <li class="comment odd alt thread-even depth-1 parent" id="comment-1135">
          <article class="comment-body" id="div-comment-1135">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/d77e4cf0b869cde6030bce26feb0a836?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              池振合
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-1135">
              <time datetime="2009-12-29T23:41:21+00:00">
               2009/12/29 23:41
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             plot(x,fg=gray(924:0/924))
             <br/>
             错误于plot.window(xlim = xlim, ylim = ylim, asp = asp, …) :
             <br/>
             图形参数”fg”的长度不对
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给池振合" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=1135#respond" onclick='return addComment.moveForm( "div-comment-1135", "1135", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
          <ol class="children">
           <li class="comment byuser comment-author-yihui even depth-2" id="comment-1137">
            <article class="comment-body" id="div-comment-1137">
             <footer class="comment-meta">
              <div class="comment-author vcard">
               <img src="http://sdn.geekzu.org/avatar/1022d8e6ebc94e8f6bca9a86cebe312a?s=74&amp;d=monsterid&amp;r=g"/>
               <b class="fn">
                <a class="url" href="http://yihui.name" rel="external nofollow">
                 谢益辉
                </a>
               </b>
               <span class="says">
                说道：
               </span>
              </div>
              <!-- .comment-author -->
              <div class="comment-metadata">
               <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-1137">
                <time datetime="2009-12-30T05:44:56+00:00">
                 2009/12/30 05:44
                </time>
               </a>
              </div>
              <!-- .comment-metadata -->
             </footer>
             <!-- .comment-meta -->
             <div class="comment-content">
              <p>
               参见你头上我的回复中的例子，这个包以及
               <code>
                sp
               </code>
               包都更新了，现在应该用
               <code>
                col
               </code>
               参数。
              </p>
             </div>
             <!-- .comment-content -->
             <div class="reply">
              <a aria-label="回复给谢益辉" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=1137#respond" onclick='return addComment.moveForm( "div-comment-1137", "1137", "respond", "1335" )' rel="nofollow">
               回复
              </a>
             </div>
            </article>
            <!-- .comment-body -->
           </li>
           <!-- #comment-## -->
          </ol>
          <!-- .children -->
         </li>
         <!-- #comment-## -->
         <li class="comment odd alt thread-odd thread-alt depth-1 parent" id="comment-1152">
          <article class="comment-body" id="div-comment-1152">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/67ff17c8c7cbaf4eeeec334f078236c9?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              xiaoz
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-1152">
              <time datetime="2010-01-05T15:56:34+00:00">
               2010/01/05 15:56
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             这个是怎么回事？
            </p>
            <p>
             &gt; getID=function(mapdata,provname)
             <br/>
             + {
             <br/>
             + index=mapdata$att.data$NAME %in% provname;
             <br/>
             + ids=rownames(mapdata$att.data[index,]);
             <br/>
             + return(as.numeric(ids));
             <br/>
             + }
             <br/>
             &gt; midchina=c(“河南省”,”山西省”,”湖北省”,”安徽省”,”湖南省”,”江西省”);
             <br/>
             &gt; plot(x,recs=getID(x,midchina),col=”green”,ol=”white”,xlab=””,
             <br/>
             + ylab=””);
             <br/>
             警告多于50个(用warnings()来显示第一个到第五十个)
             <br/>
             &gt;
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给xiaoz" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=1152#respond" onclick='return addComment.moveForm( "div-comment-1152", "1152", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
          <ol class="children">
           <li class="comment byuser comment-author-yixuanq bypostauthor even depth-2" id="comment-1153">
            <article class="comment-body" id="div-comment-1153">
             <footer class="comment-meta">
              <div class="comment-author vcard">
               <img src="http://sdn.geekzu.org/avatar/f09663fd5fc04bad5e5b09daddb86fe6?s=74&amp;d=monsterid&amp;r=g"/>
               <b class="fn">
                邱怡轩
               </b>
               <span class="says">
                说道：
               </span>
              </div>
              <!-- .comment-author -->
              <div class="comment-metadata">
               <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-1153">
                <time datetime="2010-01-05T16:39:41+00:00">
                 2010/01/05 16:39
                </time>
               </a>
              </div>
              <!-- .comment-metadata -->
             </footer>
             <!-- .comment-meta -->
             <div class="comment-content">
              <p>
               新版本的
               <code>
                maptools
               </code>
               包改动很大，我已经把文章更新了一下，参见文中的红色部分。
              </p>
             </div>
             <!-- .comment-content -->
             <div class="reply">
              <a aria-label="回复给邱怡轩" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=1153#respond" onclick='return addComment.moveForm( "div-comment-1153", "1153", "respond", "1335" )' rel="nofollow">
               回复
              </a>
             </div>
            </article>
            <!-- .comment-body -->
           </li>
           <!-- #comment-## -->
          </ol>
          <!-- .children -->
         </li>
         <!-- #comment-## -->
         <li class="comment odd alt thread-even depth-1 parent" id="comment-1155">
          <article class="comment-body" id="div-comment-1155">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/67ff17c8c7cbaf4eeeec334f078236c9?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              xiaoz
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-1155">
              <time datetime="2010-01-05T16:58:08+00:00">
               2010/01/05 16:58
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             呵呵 getColor 好像找不到了
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给xiaoz" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=1155#respond" onclick='return addComment.moveForm( "div-comment-1155", "1155", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
          <ol class="children">
           <li class="comment byuser comment-author-yixuanq bypostauthor even depth-2 parent" id="comment-1156">
            <article class="comment-body" id="div-comment-1156">
             <footer class="comment-meta">
              <div class="comment-author vcard">
               <img src="http://sdn.geekzu.org/avatar/f09663fd5fc04bad5e5b09daddb86fe6?s=74&amp;d=monsterid&amp;r=g"/>
               <b class="fn">
                邱怡轩
               </b>
               <span class="says">
                说道：
               </span>
              </div>
              <!-- .comment-author -->
              <div class="comment-metadata">
               <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-1156">
                <time datetime="2010-01-05T18:24:15+00:00">
                 2010/01/05 18:24
                </time>
               </a>
              </div>
              <!-- .comment-metadata -->
             </footer>
             <!-- .comment-meta -->
             <div class="comment-content">
              <p>
               什么意思？
               <code>
                getColor()
               </code>
               不是写在前面吗？只是需要把里面的
               <code>
                mapdata$att.data$NAME
               </code>
               改成
               <code>
                mapdata@data$NAME
               </code>
               。
              </p>
             </div>
             <!-- .comment-content -->
             <div class="reply">
              <a aria-label="回复给邱怡轩" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=1156#respond" onclick='return addComment.moveForm( "div-comment-1156", "1156", "respond", "1335" )' rel="nofollow">
               回复
              </a>
             </div>
            </article>
            <!-- .comment-body -->
            <ol class="children">
             <li class="comment odd alt depth-3" id="comment-1168">
              <article class="comment-body" id="div-comment-1168">
               <footer class="comment-meta">
                <div class="comment-author vcard">
                 <img src="http://sdn.geekzu.org/avatar/67ff17c8c7cbaf4eeeec334f078236c9?s=74&amp;d=monsterid&amp;r=g"/>
                 <b class="fn">
                  xiaoz
                 </b>
                 <span class="says">
                  说道：
                 </span>
                </div>
                <!-- .comment-author -->
                <div class="comment-metadata">
                 <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-1168">
                  <time datetime="2010-01-07T12:55:38+00:00">
                   2010/01/07 12:55
                  </time>
                 </a>
                </div>
                <!-- .comment-metadata -->
               </footer>
               <!-- .comment-meta -->
               <div class="comment-content">
                <p>
                 恩。找到了 。谢谢
                </p>
               </div>
               <!-- .comment-content -->
              </article>
              <!-- .comment-body -->
             </li>
             <!-- #comment-## -->
             <li class="comment even depth-3" id="comment-4096">
              <article class="comment-body" id="div-comment-4096">
               <footer class="comment-meta">
                <div class="comment-author vcard">
                 <img src="http://sdn.geekzu.org/avatar/9817c5999721d28aced4da978847ea2d?s=74&amp;d=monsterid&amp;r=g"/>
                 <b class="fn">
                  ellie
                 </b>
                 <span class="says">
                  说道：
                 </span>
                </div>
                <!-- .comment-author -->
                <div class="comment-metadata">
                 <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-4096">
                  <time datetime="2013-04-26T16:50:29+00:00">
                   2013/04/26 16:50
                  </time>
                 </a>
                </div>
                <!-- .comment-metadata -->
               </footer>
               <!-- .comment-meta -->
               <div class="comment-content">
                <p>
                 getColor（）按照要求修改了，但是还是显示“graphical parameter “fg” has the wrong length”。是什么原因?
                </p>
               </div>
               <!-- .comment-content -->
              </article>
              <!-- .comment-body -->
             </li>
             <!-- #comment-## -->
            </ol>
            <!-- .children -->
           </li>
           <!-- #comment-## -->
          </ol>
          <!-- .children -->
         </li>
         <!-- #comment-## -->
         <li class="comment odd alt thread-odd thread-alt depth-1 parent" id="comment-1188">
          <article class="comment-body" id="div-comment-1188">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/07f31dd479643b76aa217f4a1058a165?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              myli
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-1188">
              <time datetime="2010-01-29T16:17:00+00:00">
               2010/01/29 16:17
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             有两个问题期待大家帮助：
             <br/>
             1、原文“首先，从这里下载中国地图的GIS数据，这是一个压缩包，完全解压后包含三个文件（bou2_4p.dbf、bou2_4p.shp和bou2_4p.shx），将这三个文件解压到同一个目录下，并在R中设好相应的工作空间，然后安装maptools包，运行如下程序：”
             <br/>
             请问“工作空间”指的是什么？如何设置？
            </p>
            <p>
             2、这个地图能精细到地级市级别吗？是不是在“mapdata”包里可以看到都有什么样的数据？可我找不到包的路径。
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给myli" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=1188#respond" onclick='return addComment.moveForm( "div-comment-1188", "1188", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
          <ol class="children">
           <li class="comment byuser comment-author-yixuanq bypostauthor even depth-2 parent" id="comment-1190">
            <article class="comment-body" id="div-comment-1190">
             <footer class="comment-meta">
              <div class="comment-author vcard">
               <img src="http://sdn.geekzu.org/avatar/f09663fd5fc04bad5e5b09daddb86fe6?s=74&amp;d=monsterid&amp;r=g"/>
               <b class="fn">
                邱怡轩
               </b>
               <span class="says">
                说道：
               </span>
              </div>
              <!-- .comment-author -->
              <div class="comment-metadata">
               <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-1190">
                <time datetime="2010-01-30T09:51:10+00:00">
                 2010/01/30 09:51
                </time>
               </a>
              </div>
              <!-- .comment-metadata -->
             </footer>
             <!-- .comment-meta -->
             <div class="comment-content">
              <p>
               1、用R软件时可能经常要读取一些外部文件，引用这些文件有两种方式，一种是绝对路径，比如“C:/AAA.txt”，另一种就是把工作空间设在C:/，然后只要用相对路径“AAA.txt”就行了。说白了就是少写了一大串路径名。R中的函数是
               <code>
                setwd()
               </code>
               。
               <br/>
               2、地图的精确度与数据有关，
               <code>
                mapdata
               </code>
               里自带了一些，如果要更精确的，可以到网上去搜GIS数据。要读取
               <code>
                mapdata
               </code>
               里的数据可以这样做：
               <br/>
               <code>
                cnmapdata=map("china")
               </code>
               ，然后
               <code>
                cnmapdata$x
               </code>
               和
               <code>
                cnmapdata$y
               </code>
               就分别是经度和维度了。
              </p>
             </div>
             <!-- .comment-content -->
             <div class="reply">
              <a aria-label="回复给邱怡轩" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=1190#respond" onclick='return addComment.moveForm( "div-comment-1190", "1190", "respond", "1335" )' rel="nofollow">
               回复
              </a>
             </div>
            </article>
            <!-- .comment-body -->
            <ol class="children">
             <li class="comment odd alt depth-3" id="comment-1194">
              <article class="comment-body" id="div-comment-1194">
               <footer class="comment-meta">
                <div class="comment-author vcard">
                 <img src="http://sdn.geekzu.org/avatar/07f31dd479643b76aa217f4a1058a165?s=74&amp;d=monsterid&amp;r=g"/>
                 <b class="fn">
                  myli
                 </b>
                 <span class="says">
                  说道：
                 </span>
                </div>
                <!-- .comment-author -->
                <div class="comment-metadata">
                 <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-1194">
                  <time datetime="2010-01-31T15:56:16+00:00">
                   2010/01/31 15:56
                  </time>
                 </a>
                </div>
                <!-- .comment-metadata -->
               </footer>
               <!-- .comment-meta -->
               <div class="comment-content">
                <p>
                 谢谢，弄明白了。
                 <br/>
                 那个工作空间，原来R for beginners里就有提到。
                </p>
               </div>
               <!-- .comment-content -->
              </article>
              <!-- .comment-body -->
             </li>
             <!-- #comment-## -->
            </ol>
            <!-- .children -->
           </li>
           <!-- #comment-## -->
          </ol>
          <!-- .children -->
         </li>
         <!-- #comment-## -->
         <li class="comment even thread-even depth-1 parent" id="comment-1276">
          <article class="comment-body" id="div-comment-1276">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/a1607117467303202814dee7c0552957?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              wurui
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-1276">
              <time datetime="2010-03-19T02:17:42+00:00">
               2010/03/19 02:17
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             Very good, very strong!
            </p>
            <p>
             跟着老师给的链接找过来的，非常有帮助，谢谢楼主
            </p>
            <p>
             ps：“如果有机会的话，这一主题的下一篇文章将为大家介绍地图数据的组成结构，并说明如何将不同格式的地理数据整合起来，例如如何在上面的地图上绘制出我国的铁路、水系分布等内容。” 这部分有帖子说明吗？
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给wurui" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=1276#respond" onclick='return addComment.moveForm( "div-comment-1276", "1276", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
          <ol class="children">
           <li class="comment byuser comment-author-yixuanq bypostauthor odd alt depth-2 parent" id="comment-1279">
            <article class="comment-body" id="div-comment-1279">
             <footer class="comment-meta">
              <div class="comment-author vcard">
               <img src="http://sdn.geekzu.org/avatar/f09663fd5fc04bad5e5b09daddb86fe6?s=74&amp;d=monsterid&amp;r=g"/>
               <b class="fn">
                邱怡轩
               </b>
               <span class="says">
                说道：
               </span>
              </div>
              <!-- .comment-author -->
              <div class="comment-metadata">
               <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-1279">
                <time datetime="2010-03-19T09:38:56+00:00">
                 2010/03/19 09:38
                </time>
               </a>
              </div>
              <!-- .comment-metadata -->
             </footer>
             <!-- .comment-meta -->
             <div class="comment-content">
              <p>
               是我偷懒还没写……
              </p>
             </div>
             <!-- .comment-content -->
             <div class="reply">
              <a aria-label="回复给邱怡轩" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=1279#respond" onclick='return addComment.moveForm( "div-comment-1279", "1279", "respond", "1335" )' rel="nofollow">
               回复
              </a>
             </div>
            </article>
            <!-- .comment-body -->
            <ol class="children">
             <li class="comment even depth-3" id="comment-3385">
              <article class="comment-body" id="div-comment-3385">
               <footer class="comment-meta">
                <div class="comment-author vcard">
                 <img src="http://sdn.geekzu.org/avatar/beb15ba775be6241a4e5fc9e476e36c0?s=74&amp;d=monsterid&amp;r=g"/>
                 <b class="fn">
                  <a class="url" href="http://taiyun.cos.name" rel="external nofollow">
                   魏太云
                  </a>
                 </b>
                 <span class="says">
                  说道：
                 </span>
                </div>
                <!-- .comment-author -->
                <div class="comment-metadata">
                 <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-3385">
                  <time datetime="2012-10-18T10:39:47+00:00">
                   2012/10/18 10:39
                  </time>
                 </a>
                </div>
                <!-- .comment-metadata -->
               </footer>
               <!-- .comment-meta -->
               <div class="comment-content">
                <p>
                 坐等新作~~
                </p>
               </div>
               <!-- .comment-content -->
              </article>
              <!-- .comment-body -->
             </li>
             <!-- #comment-## -->
            </ol>
            <!-- .children -->
           </li>
           <!-- #comment-## -->
          </ol>
          <!-- .children -->
         </li>
         <!-- #comment-## -->
         <li class="comment odd alt thread-odd thread-alt depth-1 parent" id="comment-1295">
          <article class="comment-body" id="div-comment-1295">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/678528d27ad1c83846ce844efd2c0301?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              weizhangjin
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-1295">
              <time datetime="2010-03-29T22:38:48+00:00">
               2010/03/29 22:38
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             你好，你讲的这个方法很有用，但是能否绘一个省的带地市边界的图呢？
             <br/>
             比如用R绘广东省带地市边界的图？
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给weizhangjin" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=1295#respond" onclick='return addComment.moveForm( "div-comment-1295", "1295", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
          <ol class="children">
           <li class="comment byuser comment-author-yihui even depth-2" id="comment-1297">
            <article class="comment-body" id="div-comment-1297">
             <footer class="comment-meta">
              <div class="comment-author vcard">
               <img src="http://sdn.geekzu.org/avatar/1022d8e6ebc94e8f6bca9a86cebe312a?s=74&amp;d=monsterid&amp;r=g"/>
               <b class="fn">
                <a class="url" href="http://yihui.name" rel="external nofollow">
                 谢益辉
                </a>
               </b>
               <span class="says">
                说道：
               </span>
              </div>
              <!-- .comment-author -->
              <div class="comment-metadata">
               <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-1297">
                <time datetime="2010-03-30T01:42:47+00:00">
                 2010/03/30 01:42
                </time>
               </a>
              </div>
              <!-- .comment-metadata -->
             </footer>
             <!-- .comment-meta -->
             <div class="comment-content">
              <p>
               你需要下载地市边界数据，我不知道国家基础地理信息中心是否提供这种细类数据下载，你自己可以去查看一下。画图的方法都是一样的，读入shp数据，然后plot()。
              </p>
             </div>
             <!-- .comment-content -->
             <div class="reply">
              <a aria-label="回复给谢益辉" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=1297#respond" onclick='return addComment.moveForm( "div-comment-1297", "1297", "respond", "1335" )' rel="nofollow">
               回复
              </a>
             </div>
            </article>
            <!-- .comment-body -->
           </li>
           <!-- #comment-## -->
          </ol>
          <!-- .children -->
         </li>
         <!-- #comment-## -->
         <li class="comment odd alt thread-even depth-1" id="comment-1296">
          <article class="comment-body" id="div-comment-1296">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/678528d27ad1c83846ce844efd2c0301?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              weizhangjin
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-1296">
              <time datetime="2010-03-29T22:39:16+00:00">
               2010/03/29 22:39
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             能不能指点一下，谢谢
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给weizhangjin" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=1296#respond" onclick='return addComment.moveForm( "div-comment-1296", "1296", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
         </li>
         <!-- #comment-## -->
         <li class="comment even thread-odd thread-alt depth-1 parent" id="comment-1299">
          <article class="comment-body" id="div-comment-1299">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/678528d27ad1c83846ce844efd2c0301?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              weizhangjin
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-1299">
              <time datetime="2010-03-30T11:01:55+00:00">
               2010/03/30 11:01
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             你好，我在国家基础地理信息中心上没找到这种数据，哪里有呢？
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给weizhangjin" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=1299#respond" onclick='return addComment.moveForm( "div-comment-1299", "1299", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
          <ol class="children">
           <li class="comment byuser comment-author-yixuanq bypostauthor odd alt depth-2" id="comment-1300">
            <article class="comment-body" id="div-comment-1300">
             <footer class="comment-meta">
              <div class="comment-author vcard">
               <img src="http://sdn.geekzu.org/avatar/f09663fd5fc04bad5e5b09daddb86fe6?s=74&amp;d=monsterid&amp;r=g"/>
               <b class="fn">
                邱怡轩
               </b>
               <span class="says">
                说道：
               </span>
              </div>
              <!-- .comment-author -->
              <div class="comment-metadata">
               <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-1300">
                <time datetime="2010-03-30T12:25:26+00:00">
                 2010/03/30 12:25
                </time>
               </a>
              </div>
              <!-- .comment-metadata -->
             </footer>
             <!-- .comment-meta -->
             <div class="comment-content">
              <p>
               这个可以吗？
               <br/>
               <a href="http://sms.webmap.cn/xq.asp?dbid=67" rel="nofollow">
                http://sms.webmap.cn/xq.asp?dbid=67
               </a>
              </p>
             </div>
             <!-- .comment-content -->
             <div class="reply">
              <a aria-label="回复给邱怡轩" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=1300#respond" onclick='return addComment.moveForm( "div-comment-1300", "1300", "respond", "1335" )' rel="nofollow">
               回复
              </a>
             </div>
            </article>
            <!-- .comment-body -->
           </li>
           <!-- #comment-## -->
          </ol>
          <!-- .children -->
         </li>
         <!-- #comment-## -->
         <li class="comment even thread-even depth-1 parent" id="comment-1301">
          <article class="comment-body" id="div-comment-1301">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/678528d27ad1c83846ce844efd2c0301?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              weizhangjin
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-1301">
              <time datetime="2010-03-30T16:44:49+00:00">
               2010/03/30 16:44
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             这个数据估计没有用，你绘了一个中国带省界图很漂亮，能否也绘一个省图带市县界的图呢
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给weizhangjin" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=1301#respond" onclick='return addComment.moveForm( "div-comment-1301", "1301", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
          <ol class="children">
           <li class="comment odd alt depth-2" id="comment-1310">
            <article class="comment-body" id="div-comment-1310">
             <footer class="comment-meta">
              <div class="comment-author vcard">
               <img src="http://sdn.geekzu.org/avatar/924ba76180f63a8fd38cfacbc9ed3140?s=74&amp;d=monsterid&amp;r=g"/>
               <b class="fn">
                ypchen
               </b>
               <span class="says">
                说道：
               </span>
              </div>
              <!-- .comment-author -->
              <div class="comment-metadata">
               <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-1310">
                <time datetime="2010-04-01T19:41:16+00:00">
                 2010/04/01 19:41
                </time>
               </a>
              </div>
              <!-- .comment-metadata -->
             </footer>
             <!-- .comment-meta -->
             <div class="comment-content">
              <p>
               要看有没有数据吧
              </p>
             </div>
             <!-- .comment-content -->
             <div class="reply">
              <a aria-label="回复给ypchen" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=1310#respond" onclick='return addComment.moveForm( "div-comment-1310", "1310", "respond", "1335" )' rel="nofollow">
               回复
              </a>
             </div>
            </article>
            <!-- .comment-body -->
           </li>
           <!-- #comment-## -->
          </ol>
          <!-- .children -->
         </li>
         <!-- #comment-## -->
         <li class="comment even thread-odd thread-alt depth-1" id="comment-1304">
          <article class="comment-body" id="div-comment-1304">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/678528d27ad1c83846ce844efd2c0301?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              weizhangjin
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-1304">
              <time datetime="2010-03-30T17:26:48+00:00">
               2010/03/30 17:26
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             哦，你好！怎么把省的名称自动写到地图里呢？
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给weizhangjin" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=1304#respond" onclick='return addComment.moveForm( "div-comment-1304", "1304", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
         </li>
         <!-- #comment-## -->
         <li class="comment odd alt thread-even depth-1" id="comment-1593">
          <article class="comment-body" id="div-comment-1593">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/ce000609a7f2dbe6a196c00db6e3f1f1?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              lywzh
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-1593">
              <time datetime="2010-08-08T11:24:53+00:00">
               2010/08/08 11:24
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             我想问问怎么确定广东省各市的边界，太需要了，谢谢
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给lywzh" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=1593#respond" onclick='return addComment.moveForm( "div-comment-1593", "1593", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
         </li>
         <!-- #comment-## -->
         <li class="comment even thread-odd thread-alt depth-1" id="comment-1594">
          <article class="comment-body" id="div-comment-1594">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/ce000609a7f2dbe6a196c00db6e3f1f1?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              lywzh
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-1594">
              <time datetime="2010-08-08T11:28:12+00:00">
               2010/08/08 11:28
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             另外，数据包中（bou2_4l.dbf、bou2_4l.shp和bou2_4l.shx），的bout2_4l.shp为什么读不了呢？
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给lywzh" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=1594#respond" onclick='return addComment.moveForm( "div-comment-1594", "1594", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
         </li>
         <!-- #comment-## -->
         <li class="comment odd alt thread-even depth-1 parent" id="comment-1602">
          <article class="comment-body" id="div-comment-1602">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/15889ffa4d91e57df00becfff2f62ebb?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              liujs606
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-1602">
              <time datetime="2010-08-28T04:19:42+00:00">
               2010/08/28 04:19
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             请问maptools中的Map2poly改成什么了？
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给liujs606" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=1602#respond" onclick='return addComment.moveForm( "div-comment-1602", "1602", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
          <ol class="children">
           <li class="comment byuser comment-author-yixuanq bypostauthor even depth-2 parent" id="comment-1605">
            <article class="comment-body" id="div-comment-1605">
             <footer class="comment-meta">
              <div class="comment-author vcard">
               <img src="http://sdn.geekzu.org/avatar/f09663fd5fc04bad5e5b09daddb86fe6?s=74&amp;d=monsterid&amp;r=g"/>
               <b class="fn">
                邱怡轩
               </b>
               <span class="says">
                说道：
               </span>
              </div>
              <!-- .comment-author -->
              <div class="comment-metadata">
               <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-1605">
                <time datetime="2010-08-28T14:41:43+00:00">
                 2010/08/28 14:41
                </time>
               </a>
              </div>
              <!-- .comment-metadata -->
             </footer>
             <!-- .comment-meta -->
             <div class="comment-content">
              <p>
               应该是被删了，但可以从地图信息中提取，你试一下下面的代码，函数会返回一个列表，其中每一个元素是一个矩阵，第一列是多边形横坐标，第二列是多边形纵坐标。
              </p>
              <pre class="brush: r">myMap2poly=function(mapdata)
{
    lapply(x@polygons,function(x) x@Polygons[[1]]@coords);
}
mapPolygon=myMap2poly(x);
hlj.x=mapPolygon[[1]][,1];
hlj.y=mapPolygon[[1]][,2];
plot(1,xlim=range(hlj.x),ylim=range(hlj.y),type="n");
polygon(hlj.x,hlj.y);
</pre>
             </div>
             <!-- .comment-content -->
             <div class="reply">
              <a aria-label="回复给邱怡轩" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=1605#respond" onclick='return addComment.moveForm( "div-comment-1605", "1605", "respond", "1335" )' rel="nofollow">
               回复
              </a>
             </div>
            </article>
            <!-- .comment-body -->
            <ol class="children">
             <li class="comment odd alt depth-3" id="comment-1655">
              <article class="comment-body" id="div-comment-1655">
               <footer class="comment-meta">
                <div class="comment-author vcard">
                 <img src="http://sdn.geekzu.org/avatar/9b60ec5bb808c333bf90141ea6d11190?s=74&amp;d=monsterid&amp;r=g"/>
                 <b class="fn">
                  Jushan Liu
                 </b>
                 <span class="says">
                  说道：
                 </span>
                </div>
                <!-- .comment-author -->
                <div class="comment-metadata">
                 <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-1655">
                  <time datetime="2010-09-28T07:25:37+00:00">
                   2010/09/28 07:25
                  </time>
                 </a>
                </div>
                <!-- .comment-metadata -->
               </footer>
               <!-- .comment-meta -->
               <div class="comment-content">
                <p>
                 我读进去SHP数据后，运行
                 <br/>
                 myMap2poly=function(mapdata)
                 <br/>
                 {
                 <br/>
                 lapply(x@polygons,function(x) x@Polygons[[1]]@coords);
                 <br/>
                 }
                 <br/>
                 mapPolygon=myMap2poly(x)
                 <br/>
                 出现错误提示Error in is.vector(X) : object ‘x’ not found
                 <br/>
                 是什么问题？
                </p>
               </div>
               <!-- .comment-content -->
              </article>
              <!-- .comment-body -->
             </li>
             <!-- #comment-## -->
            </ol>
            <!-- .children -->
           </li>
           <!-- #comment-## -->
           <li class="comment byuser comment-author-yixuanq bypostauthor even depth-2 parent" id="comment-1658">
            <article class="comment-body" id="div-comment-1658">
             <footer class="comment-meta">
              <div class="comment-author vcard">
               <img src="http://sdn.geekzu.org/avatar/f09663fd5fc04bad5e5b09daddb86fe6?s=74&amp;d=monsterid&amp;r=g"/>
               <b class="fn">
                邱怡轩
               </b>
               <span class="says">
                说道：
               </span>
              </div>
              <!-- .comment-author -->
              <div class="comment-metadata">
               <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-1658">
                <time datetime="2010-09-28T12:34:48+00:00">
                 2010/09/28 12:34
                </time>
               </a>
              </div>
              <!-- .comment-metadata -->
             </footer>
             <!-- .comment-meta -->
             <div class="comment-content">
              <p>
               我犯糊涂了，应该把那个函数中的x改成mapdata，正确的函数应该是
              </p>
              <pre class="brush: r">myMap2poly=function(mapdata)
{
    lapply(mapdata@polygons,function(x) x@Polygons[[1]]@coords);
}</pre>
             </div>
             <!-- .comment-content -->
             <div class="reply">
              <a aria-label="回复给邱怡轩" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=1658#respond" onclick='return addComment.moveForm( "div-comment-1658", "1658", "respond", "1335" )' rel="nofollow">
               回复
              </a>
             </div>
            </article>
            <!-- .comment-body -->
            <ol class="children">
             <li class="comment odd alt depth-3" id="comment-1660">
              <article class="comment-body" id="div-comment-1660">
               <footer class="comment-meta">
                <div class="comment-author vcard">
                 <img src="http://sdn.geekzu.org/avatar/9b60ec5bb808c333bf90141ea6d11190?s=74&amp;d=monsterid&amp;r=g"/>
                 <b class="fn">
                  Jushan Liu
                 </b>
                 <span class="says">
                  说道：
                 </span>
                </div>
                <!-- .comment-author -->
                <div class="comment-metadata">
                 <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-1660">
                  <time datetime="2010-09-29T08:15:15+00:00">
                   2010/09/29 08:15
                  </time>
                 </a>
                </div>
                <!-- .comment-metadata -->
               </footer>
               <!-- .comment-meta -->
               <div class="comment-content">
                <p>
                 多谢，我当时可能头脑不清楚，哈哈
                </p>
               </div>
               <!-- .comment-content -->
              </article>
              <!-- .comment-body -->
             </li>
             <!-- #comment-## -->
            </ol>
            <!-- .children -->
           </li>
           <!-- #comment-## -->
          </ol>
          <!-- .children -->
         </li>
         <!-- #comment-## -->
         <li class="comment even thread-odd thread-alt depth-1 parent" id="comment-1603">
          <article class="comment-body" id="div-comment-1603">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/15889ffa4d91e57df00becfff2f62ebb?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              liujs606
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-1603">
              <time datetime="2010-08-28T06:31:15+00:00">
               2010/08/28 06:31
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             在R中输入“x[[2]]”得到包含925个元素的数组
             <br/>
             [1] 68.489 129.933 84.905 41.186 38.379 76.781 44.874  8.498  0.088
             <br/>
             [10] 0.047 0.096 0.114 0.061   0.052   0.041   0.066   0.056   0.064
             <br/>
             用“x$att.data”得到NULL
             <br/>
             我用attributes（x）发现里边有乱码$data
             <br/>
             AREA PERIMETER BOU2_4M_ BOU2_4M_ID ADCODE93 ADCODE99       NAME
             <br/>
             0    54.447    68.489     2         23   230000   230000  ºÚÁú½­Ê¡
             <br/>
             1   129.113   129.933     3         15   150000   150000 ÄÚÃÉ¹Å×ÔÖÎÇø
             <br/>
             这些问题怎么解决？请指教
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给liujs606" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=1603#respond" onclick='return addComment.moveForm( "div-comment-1603", "1603", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
          <ol class="children">
           <li class="comment byuser comment-author-yixuanq bypostauthor odd alt depth-2" id="comment-1604">
            <article class="comment-body" id="div-comment-1604">
             <footer class="comment-meta">
              <div class="comment-author vcard">
               <img src="http://sdn.geekzu.org/avatar/f09663fd5fc04bad5e5b09daddb86fe6?s=74&amp;d=monsterid&amp;r=g"/>
               <b class="fn">
                邱怡轩
               </b>
               <span class="says">
                说道：
               </span>
              </div>
              <!-- .comment-author -->
              <div class="comment-metadata">
               <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-1604">
                <time datetime="2010-08-28T14:17:54+00:00">
                 2010/08/28 14:17
                </time>
               </a>
              </div>
              <!-- .comment-metadata -->
             </footer>
             <!-- .comment-meta -->
             <div class="comment-content">
              <p>
               maptools包进行改版后，数据结构也发生了变化，原来的
               <code>
                x[[2]]
               </code>
               或
               <code>
                x$att.data
               </code>
               相当于现在的
               <code>
                x@data
               </code>
               。乱码问题应该是编码造成的，在我这里没问题，你再试试看。
              </p>
             </div>
             <!-- .comment-content -->
             <div class="reply">
              <a aria-label="回复给邱怡轩" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=1604#respond" onclick='return addComment.moveForm( "div-comment-1604", "1604", "respond", "1335" )' rel="nofollow">
               回复
              </a>
             </div>
            </article>
            <!-- .comment-body -->
           </li>
           <!-- #comment-## -->
          </ol>
          <!-- .children -->
         </li>
         <!-- #comment-## -->
         <li class="comment even thread-even depth-1 parent" id="comment-1606">
          <article class="comment-body" id="div-comment-1606">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/15889ffa4d91e57df00becfff2f62ebb?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              liujs606
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-1606">
              <time datetime="2010-08-28T21:53:28+00:00">
               2010/08/28 21:53
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             早晨睁眼就来看您的答复,非常感谢
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给liujs606" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=1606#respond" onclick='return addComment.moveForm( "div-comment-1606", "1606", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
          <ol class="children">
           <li class="comment byuser comment-author-yixuanq bypostauthor odd alt depth-2 parent" id="comment-1607">
            <article class="comment-body" id="div-comment-1607">
             <footer class="comment-meta">
              <div class="comment-author vcard">
               <img src="http://sdn.geekzu.org/avatar/f09663fd5fc04bad5e5b09daddb86fe6?s=74&amp;d=monsterid&amp;r=g"/>
               <b class="fn">
                邱怡轩
               </b>
               <span class="says">
                说道：
               </span>
              </div>
              <!-- .comment-author -->
              <div class="comment-metadata">
               <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-1607">
                <time datetime="2010-08-28T22:05:51+00:00">
                 2010/08/28 22:05
                </time>
               </a>
              </div>
              <!-- .comment-metadata -->
             </footer>
             <!-- .comment-meta -->
             <div class="comment-content">
              <p>
               你是在加拿大上学吗？
              </p>
             </div>
             <!-- .comment-content -->
             <div class="reply">
              <a aria-label="回复给邱怡轩" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=1607#respond" onclick='return addComment.moveForm( "div-comment-1607", "1607", "respond", "1335" )' rel="nofollow">
               回复
              </a>
             </div>
            </article>
            <!-- .comment-body -->
            <ol class="children">
             <li class="comment even depth-3" id="comment-1608">
              <article class="comment-body" id="div-comment-1608">
               <footer class="comment-meta">
                <div class="comment-author vcard">
                 <img src="http://sdn.geekzu.org/avatar/15889ffa4d91e57df00becfff2f62ebb?s=74&amp;d=monsterid&amp;r=g"/>
                 <b class="fn">
                  liujs606
                 </b>
                 <span class="says">
                  说道：
                 </span>
                </div>
                <!-- .comment-author -->
                <div class="comment-metadata">
                 <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-1608">
                  <time datetime="2010-08-29T03:38:07+00:00">
                   2010/08/29 03:38
                  </time>
                 </a>
                </div>
                <!-- .comment-metadata -->
               </footer>
               <!-- .comment-meta -->
               <div class="comment-content">
                <p>
                 我在加拿大放学一年，有个项目是关于加拿大北方森林物种特征时空变异的项目，需要把一些物种在加拿大地图上标记出来，并且预测30，60年后的分布情况，您在什么单位，能否单独联系您，我邮箱是liujs606@gmail.com
                </p>
               </div>
               <!-- .comment-content -->
              </article>
              <!-- .comment-body -->
             </li>
             <!-- #comment-## -->
            </ol>
            <!-- .children -->
           </li>
           <!-- #comment-## -->
          </ol>
          <!-- .children -->
         </li>
         <!-- #comment-## -->
         <li class="comment odd alt thread-odd thread-alt depth-1 parent" id="comment-1643">
          <article class="comment-body" id="div-comment-1643">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/9b60ec5bb808c333bf90141ea6d11190?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              liujs606
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-1643">
              <time datetime="2010-09-21T05:07:49+00:00">
               2010/09/21 05:07
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             您好，现在我有两个问题，假如把各省份用不同颜色区分后，想加个图例，把每个颜色代表的身份用图例表示出来，怎么加？
             <br/>
             第二个问题，我如果有中国分省市地图的SHP数据，还有包括经纬度的样品数据，我可以把样品的分布在该地图上表示出来，根据这两个数据，能否把我样品数据中的各个记录按照省份归类？进而可以对每个省份的数据分布进行分析。
            </p>
            <p>
             不知道有没有表达明白我的问题，想上传两个图片，但是不知道这里怎么上传，期待您的答复
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给liujs606" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=1643#respond" onclick='return addComment.moveForm( "div-comment-1643", "1643", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
          <ol class="children">
           <li class="comment byuser comment-author-yixuanq bypostauthor even depth-2 parent" id="comment-1644">
            <article class="comment-body" id="div-comment-1644">
             <footer class="comment-meta">
              <div class="comment-author vcard">
               <img src="http://sdn.geekzu.org/avatar/f09663fd5fc04bad5e5b09daddb86fe6?s=74&amp;d=monsterid&amp;r=g"/>
               <b class="fn">
                邱怡轩
               </b>
               <span class="says">
                说道：
               </span>
              </div>
              <!-- .comment-author -->
              <div class="comment-metadata">
               <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-1644">
                <time datetime="2010-09-22T09:35:40+00:00">
                 2010/09/22 09:35
                </time>
               </a>
              </div>
              <!-- .comment-metadata -->
             </footer>
             <!-- .comment-meta -->
             <div class="comment-content">
              <p>
               图例可以用
               <code>
                legend()
               </code>
               函数；第二个问题是不是相当于给定一个经纬度，然后判断它在哪个省？
              </p>
             </div>
             <!-- .comment-content -->
             <div class="reply">
              <a aria-label="回复给邱怡轩" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=1644#respond" onclick='return addComment.moveForm( "div-comment-1644", "1644", "respond", "1335" )' rel="nofollow">
               回复
              </a>
             </div>
            </article>
            <!-- .comment-body -->
            <ol class="children">
             <li class="comment odd alt depth-3 parent" id="comment-2473">
              <article class="comment-body" id="div-comment-2473">
               <footer class="comment-meta">
                <div class="comment-author vcard">
                 <img src="http://sdn.geekzu.org/avatar/1d588ca4874520ec834972513f41aab4?s=74&amp;d=monsterid&amp;r=g"/>
                 <b class="fn">
                  priss111
                 </b>
                 <span class="says">
                  说道：
                 </span>
                </div>
                <!-- .comment-author -->
                <div class="comment-metadata">
                 <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-2473">
                  <time datetime="2011-09-27T15:11:56+00:00">
                   2011/09/27 15:11
                  </time>
                 </a>
                </div>
                <!-- .comment-metadata -->
               </footer>
               <!-- .comment-meta -->
               <div class="comment-content">
                <p>
                 请问：
                 <br/>
                 只用中国某省的地图，
                 <br/>
                 绘制某事件（可以以人口数为例）在该省各个地市的频数分布，
                 <br/>
                 这个的code该如何修改？
                 <br/>
                 谢谢！
                </p>
               </div>
               <!-- .comment-content -->
              </article>
              <!-- .comment-body -->
             </li>
             <!-- #comment-## -->
             <li class="comment byuser comment-author-yixuanq bypostauthor even depth-3" id="comment-2475">
              <article class="comment-body" id="div-comment-2475">
               <footer class="comment-meta">
                <div class="comment-author vcard">
                 <img src="http://sdn.geekzu.org/avatar/f09663fd5fc04bad5e5b09daddb86fe6?s=74&amp;d=monsterid&amp;r=g"/>
                 <b class="fn">
                  邱怡轩
                 </b>
                 <span class="says">
                  说道：
                 </span>
                </div>
                <!-- .comment-author -->
                <div class="comment-metadata">
                 <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-2475">
                  <time datetime="2011-09-27T16:45:50+00:00">
                   2011/09/27 16:45
                  </time>
                 </a>
                </div>
                <!-- .comment-metadata -->
               </footer>
               <!-- .comment-meta -->
               <div class="comment-content">
                <p>
                 基本上差不多，就是地图的数据，还有城市名称等地方需要更新。
                </p>
               </div>
               <!-- .comment-content -->
              </article>
              <!-- .comment-body -->
             </li>
             <!-- #comment-## -->
             <li class="comment odd alt depth-3 parent" id="comment-2476">
              <article class="comment-body" id="div-comment-2476">
               <footer class="comment-meta">
                <div class="comment-author vcard">
                 <img src="http://sdn.geekzu.org/avatar/1d588ca4874520ec834972513f41aab4?s=74&amp;d=monsterid&amp;r=g"/>
                 <b class="fn">
                  priss111
                 </b>
                 <span class="says">
                  说道：
                 </span>
                </div>
                <!-- .comment-author -->
                <div class="comment-metadata">
                 <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-2476">
                  <time datetime="2011-09-27T17:23:17+00:00">
                   2011/09/27 17:23
                  </time>
                 </a>
                </div>
                <!-- .comment-metadata -->
               </footer>
               <!-- .comment-meta -->
               <div class="comment-content">
                <p>
                 请问我如何获取该省的地图数据？
                 <br/>
                 我不知道去哪里能够下载到数据.
                 <br/>
                 谢谢！
                </p>
               </div>
               <!-- .comment-content -->
              </article>
              <!-- .comment-body -->
             </li>
             <!-- #comment-## -->
             <li class="comment byuser comment-author-yixuanq bypostauthor even depth-3" id="comment-2494">
              <article class="comment-body" id="div-comment-2494">
               <footer class="comment-meta">
                <div class="comment-author vcard">
                 <img src="http://sdn.geekzu.org/avatar/f09663fd5fc04bad5e5b09daddb86fe6?s=74&amp;d=monsterid&amp;r=g"/>
                 <b class="fn">
                  邱怡轩
                 </b>
                 <span class="says">
                  说道：
                 </span>
                </div>
                <!-- .comment-author -->
                <div class="comment-metadata">
                 <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-2494">
                  <time datetime="2011-09-29T23:51:24+00:00">
                   2011/09/29 23:51
                  </time>
                 </a>
                </div>
                <!-- .comment-metadata -->
               </footer>
               <!-- .comment-meta -->
               <div class="comment-content">
                <p>
                 这里可能有你需要的：
                 <a href="http://www.gadm.org/country" rel="nofollow">
                  http://www.gadm.org/country
                 </a>
                 。
                </p>
               </div>
               <!-- .comment-content -->
              </article>
              <!-- .comment-body -->
             </li>
             <!-- #comment-## -->
             <li class="comment odd alt depth-3 parent" id="comment-2495">
              <article class="comment-body" id="div-comment-2495">
               <footer class="comment-meta">
                <div class="comment-author vcard">
                 <img src="http://sdn.geekzu.org/avatar/1d588ca4874520ec834972513f41aab4?s=74&amp;d=monsterid&amp;r=g"/>
                 <b class="fn">
                  priss111
                 </b>
                 <span class="says">
                  说道：
                 </span>
                </div>
                <!-- .comment-author -->
                <div class="comment-metadata">
                 <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-2495">
                  <time datetime="2011-09-30T09:10:24+00:00">
                   2011/09/30 09:10
                  </time>
                 </a>
                </div>
                <!-- .comment-metadata -->
               </footer>
               <!-- .comment-meta -->
               <div class="comment-content">
                <p>
                 谢谢！
                </p>
                <p>
                 在gadm中下载了china的shapefile压缩文件，
                 <br/>
                 解压后把后缀为.shp/.dbf及相应同名的SHX文件放入getwd()中，
                 <br/>
                 运行下面这段code，
                 <br/>
                 提示： 错误于colIndex + 1 : 二进列运算符中有非数值参数.
                </p>
                <p>
                 是因为省名是汉字导致该错误？
                 <br/>
                 还是因为其他原因？
                 <br/>
                 请高手帮忙查看一下，
                 <br/>
                 谢谢！
                </p>
                <p>
                 我初学R,
                 <br/>
                 又需要绘制一幅某省的各地市某事件频数分布地图.
                </p>
                <p>
                 library(maps)
                 <br/>
                 library(mapdata)
                 <br/>
                 map(“china”)
                 <br/>
                 library(maptools)
                 <br/>
                 x=readShapePoly(“CHN_adm3.shp”)
                 <br/>
                 plot(x)
                 <br/>
                 plot(x,col=gray(924:0/924))
                 <br/>
                 #####全国地图中突出显示湖北
                 <br/>
                 getColor=function(mapdata,provname,provcol,othercol)
                 <br/>
                 {
                 <br/>
                 f=function(x,y) ifelse(x %in% y, which(y==x),0)
                 <br/>
                 colIndex=sapply(mapdata@data$NAME,f,provname)
                 <br/>
                 col=c(othercol,provcol)[colIndex+1]
                 <br/>
                 return(col)
                 <br/>
                 }
                </p>
                <p>
                 provname=c(“湖北省”)
                 <br/>
                 provcol=c(“red”)
                 <br/>
                 plot(x,col=getColor(x,provname,provcol,”white”))
                 <br/>
                 错误于colIndex + 1 : 二进列运算符中有非数值参数
                </p>
               </div>
               <!-- .comment-content -->
              </article>
              <!-- .comment-body -->
             </li>
             <!-- #comment-## -->
             <li class="comment byuser comment-author-yixuanq bypostauthor even depth-3" id="comment-2496">
              <article class="comment-body" id="div-comment-2496">
               <footer class="comment-meta">
                <div class="comment-author vcard">
                 <img src="http://sdn.geekzu.org/avatar/f09663fd5fc04bad5e5b09daddb86fe6?s=74&amp;d=monsterid&amp;r=g"/>
                 <b class="fn">
                  邱怡轩
                 </b>
                 <span class="says">
                  说道：
                 </span>
                </div>
                <!-- .comment-author -->
                <div class="comment-metadata">
                 <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-2496">
                  <time datetime="2011-09-30T09:21:17+00:00">
                   2011/09/30 09:21
                  </time>
                 </a>
                </div>
                <!-- .comment-metadata -->
               </footer>
               <!-- .comment-meta -->
               <div class="comment-content">
                <p>
                 这个数据是包含了城市的，直接用原来的代码肯定不行。如果时间允许的话我想重新整理一篇地图绘制的文章，只是可能得等一段时间了。
                </p>
               </div>
               <!-- .comment-content -->
              </article>
              <!-- .comment-body -->
             </li>
             <!-- #comment-## -->
             <li class="comment odd alt depth-3" id="comment-2497">
              <article class="comment-body" id="div-comment-2497">
               <footer class="comment-meta">
                <div class="comment-author vcard">
                 <img src="http://sdn.geekzu.org/avatar/1d588ca4874520ec834972513f41aab4?s=74&amp;d=monsterid&amp;r=g"/>
                 <b class="fn">
                  priss111
                 </b>
                 <span class="says">
                  说道：
                 </span>
                </div>
                <!-- .comment-author -->
                <div class="comment-metadata">
                 <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-2497">
                  <time datetime="2011-09-30T09:27:09+00:00">
                   2011/09/30 09:27
                  </time>
                 </a>
                </div>
                <!-- .comment-metadata -->
               </footer>
               <!-- .comment-meta -->
               <div class="comment-content">
                <p>
                 哦,
                 <br/>
                 期待中…
                </p>
                <p>
                 现在关键是不知道有城市的shapefile的3个文件转化成我需要的分布地图的思路,
                 <br/>
                 又是初学,
                 <br/>
                 所以不知从何下手.
                </p>
               </div>
               <!-- .comment-content -->
              </article>
              <!-- .comment-body -->
             </li>
             <!-- #comment-## -->
             <li class="comment byuser comment-author-yihui even depth-3 parent" id="comment-2498">
              <article class="comment-body" id="div-comment-2498">
               <footer class="comment-meta">
                <div class="comment-author vcard">
                 <img src="http://sdn.geekzu.org/avatar/1022d8e6ebc94e8f6bca9a86cebe312a?s=74&amp;d=monsterid&amp;r=g"/>
                 <b class="fn">
                  <a class="url" href="http://yihui.name" rel="external nofollow">
                   谢益辉
                  </a>
                 </b>
                 <span class="says">
                  说道：
                 </span>
                </div>
                <!-- .comment-author -->
                <div class="comment-metadata">
                 <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-2498">
                  <time datetime="2011-09-30T10:18:48+00:00">
                   2011/09/30 10:18
                  </time>
                 </a>
                </div>
                <!-- .comment-metadata -->
               </footer>
               <!-- .comment-meta -->
               <div class="comment-content">
                <p>
                 这个gadm.org网站太牛了，谢谢！
                </p>
               </div>
               <!-- .comment-content -->
              </article>
              <!-- .comment-body -->
             </li>
             <!-- #comment-## -->
             <li class="comment byuser comment-author-yixuanq bypostauthor odd alt depth-3" id="comment-2499">
              <article class="comment-body" id="div-comment-2499">
               <footer class="comment-meta">
                <div class="comment-author vcard">
                 <img src="http://sdn.geekzu.org/avatar/f09663fd5fc04bad5e5b09daddb86fe6?s=74&amp;d=monsterid&amp;r=g"/>
                 <b class="fn">
                  邱怡轩
                 </b>
                 <span class="says">
                  说道：
                 </span>
                </div>
                <!-- .comment-author -->
                <div class="comment-metadata">
                 <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-2499">
                  <time datetime="2011-09-30T10:30:28+00:00">
                   2011/09/30 10:30
                  </time>
                 </a>
                </div>
                <!-- .comment-metadata -->
               </footer>
               <!-- .comment-meta -->
               <div class="comment-content">
                <p>
                 最强悍的一点是它直接提供RData格式的数据，在R里
                 <code>
                  load()
                 </code>
                 一下就进去了。
                </p>
               </div>
               <!-- .comment-content -->
              </article>
              <!-- .comment-body -->
             </li>
             <!-- #comment-## -->
            </ol>
            <!-- .children -->
           </li>
           <!-- #comment-## -->
          </ol>
          <!-- .children -->
         </li>
         <!-- #comment-## -->
         <li class="comment even thread-even depth-1" id="comment-1645">
          <article class="comment-body" id="div-comment-1645">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/9b60ec5bb808c333bf90141ea6d11190?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              liujs606
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-1645">
              <time datetime="2010-09-22T13:03:58+00:00">
               2010/09/22 13:03
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             第二个问题是，样品数据中有经纬度，关键是怎么能从GIS数据中分离出每个省的经纬度范围，您有没有好的建议？
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给liujs606" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=1645#respond" onclick='return addComment.moveForm( "div-comment-1645", "1645", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
         </li>
         <!-- #comment-## -->
         <li class="comment odd alt thread-odd thread-alt depth-1 parent" id="comment-1654">
          <article class="comment-body" id="div-comment-1654">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/9b60ec5bb808c333bf90141ea6d11190?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              Jushan Liu
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-1654">
              <time datetime="2010-09-28T07:04:58+00:00">
               2010/09/28 07:04
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             原来maptools中的Map2poly现在改成什么了？
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给Jushan Liu" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=1654#respond" onclick='return addComment.moveForm( "div-comment-1654", "1654", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
          <ol class="children">
           <li class="comment even depth-2" id="comment-1657">
            <article class="comment-body" id="div-comment-1657">
             <footer class="comment-meta">
              <div class="comment-author vcard">
               <img src="http://sdn.geekzu.org/avatar/9b60ec5bb808c333bf90141ea6d11190?s=74&amp;d=monsterid&amp;r=g"/>
               <b class="fn">
                Jushan Liu
               </b>
               <span class="says">
                说道：
               </span>
              </div>
              <!-- .comment-author -->
              <div class="comment-metadata">
               <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-1657">
                <time datetime="2010-09-28T12:14:57+00:00">
                 2010/09/28 12:14
                </time>
               </a>
              </div>
              <!-- .comment-metadata -->
             </footer>
             <!-- .comment-meta -->
             <div class="comment-content">
              <p>
               不好意思，以前问过这个问题，不用回答了
              </p>
             </div>
             <!-- .comment-content -->
             <div class="reply">
              <a aria-label="回复给Jushan Liu" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=1657#respond" onclick='return addComment.moveForm( "div-comment-1657", "1657", "respond", "1335" )' rel="nofollow">
               回复
              </a>
             </div>
            </article>
            <!-- .comment-body -->
           </li>
           <!-- #comment-## -->
          </ol>
          <!-- .children -->
         </li>
         <!-- #comment-## -->
         <li class="comment odd alt thread-even depth-1" id="comment-1659">
          <article class="comment-body" id="div-comment-1659">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/211ac065e8773feeebc74ac77f5acd87?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              Long Qin
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-1659">
              <time datetime="2010-09-28T12:56:26+00:00">
               2010/09/28 12:56
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             用SAS试一下：
             <br/>
             data china2;
             <br/>
             length IDNAME $18;
             <br/>
             input ID IDNAME $;
             <br/>
             cards;
             <br/>
             1 安徽省
             <br/>
             22 北京市
             <br/>
             33 重庆市
             <br/>
             7 福建省
             <br/>
             15 甘肃省
             <br/>
             30 广东省
             <br/>
             16 广西壮族自治区
             <br/>
             18 贵州省
             <br/>
             31 海南省
             <br/>
             10 河北省
             <br/>
             8 黑龙江省
             <br/>
             9 河南省
             <br/>
             34 香港特别行政区
             <br/>
             12 湖北省
             <br/>
             11 湖南省
             <br/>
             4 江苏省
             <br/>
             3 江西省
             <br/>
             5 吉林省
             <br/>
             19 辽宁省
             <br/>
             35 澳门特别行政区
             <br/>
             20 内蒙古自治区
             <br/>
             21 宁夏回族自治区
             <br/>
             6 青海省
             <br/>
             26 陕西省
             <br/>
             25 山东省
             <br/>
             23 上海市
             <br/>
             24 山西省
             <br/>
             32 四川省
             <br/>
             36 台湾省
             <br/>
             28 天津市
             <br/>
             13 新疆维吾尔自治区
             <br/>
             14 西藏自治区
             <br/>
             29 云南省
             <br/>
             2 浙江省
             <br/>
             ;
             <br/>
             run;
            </p>
            <p>
             %annomac;
             <br/>
             %MAPLABEL (maps.china,china2,labelout,idname,id,font=simhei,color=crimson,size=2,hsys=3);
            </p>
            <p>
             proc gmap map=maps.china data=china2 all;
             <br/>
             id id;
             <br/>
             choro idname / nolegend levels=1 anno=labelout;
             <br/>
             run;quit;
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给Long Qin" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=1659#respond" onclick='return addComment.moveForm( "div-comment-1659", "1659", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
         </li>
         <!-- #comment-## -->
         <li class="comment even thread-odd thread-alt depth-1 parent" id="comment-1661">
          <article class="comment-body" id="div-comment-1661">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/35cce3c0fbe24c2ef1b921bd62872e3e?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              my9690
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-1661">
              <time datetime="2010-10-05T17:37:15+00:00">
               2010/10/05 17:37
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             不好意思，由于maptools程序包更改的太多，而且上文用到的GIS数据也有更新，所以，现在看您的博文有很多地方对应不上。
             <br/>
             您能按现在的GIS数据和maptools程序包重新更新一下内容吗？
             <br/>
             正在写论文，很急需这部分内容，查找了很多书，书上没有这部分。看您的文章有很大的提示，很感谢您。麻烦您按照现在的内容更新一下代码好吗，谢谢。
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给my9690" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=1661#respond" onclick='return addComment.moveForm( "div-comment-1661", "1661", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
          <ol class="children">
           <li class="comment byuser comment-author-yixuanq bypostauthor odd alt depth-2" id="comment-1663">
            <article class="comment-body" id="div-comment-1663">
             <footer class="comment-meta">
              <div class="comment-author vcard">
               <img src="http://sdn.geekzu.org/avatar/f09663fd5fc04bad5e5b09daddb86fe6?s=74&amp;d=monsterid&amp;r=g"/>
               <b class="fn">
                邱怡轩
               </b>
               <span class="says">
                说道：
               </span>
              </div>
              <!-- .comment-author -->
              <div class="comment-metadata">
               <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-1663">
                <time datetime="2010-10-06T09:38:43+00:00">
                 2010/10/06 09:38
                </time>
               </a>
              </div>
              <!-- .comment-metadata -->
             </footer>
             <!-- .comment-meta -->
             <div class="comment-content">
              <p>
               呃，关键的地方我已经用红色的文字重新修正了，不知道还有哪些地方需要更新？最好是能列出一个清单，我重新更新一下。
              </p>
             </div>
             <!-- .comment-content -->
             <div class="reply">
              <a aria-label="回复给邱怡轩" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=1663#respond" onclick='return addComment.moveForm( "div-comment-1663", "1663", "respond", "1335" )' rel="nofollow">
               回复
              </a>
             </div>
            </article>
            <!-- .comment-body -->
           </li>
           <!-- #comment-## -->
          </ol>
          <!-- .children -->
         </li>
         <!-- #comment-## -->
         <li class="comment even thread-even depth-1" id="comment-1662">
          <article class="comment-body" id="div-comment-1662">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/35cce3c0fbe24c2ef1b921bd62872e3e?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              my9690
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-1662">
              <time datetime="2010-10-05T20:01:20+00:00">
               2010/10/05 20:01
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             您好，非常不好意思麻烦您。
             <br/>
             由于maptools和Gis文件的更新都比较大，您可以重新更新一下博文吗？
             <br/>
             很着急学这部分内容，谢谢您了。
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给my9690" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=1662#respond" onclick='return addComment.moveForm( "div-comment-1662", "1662", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
         </li>
         <!-- #comment-## -->
         <li class="comment odd alt thread-odd thread-alt depth-1 parent" id="comment-1707">
          <article class="comment-body" id="div-comment-1707">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/6b96a772d9ef16d4cb49fe35c8f5da10?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              zwdbordeaux
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-1707">
              <time datetime="2010-11-11T08:06:57+00:00">
               2010/11/11 08:06
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             研究了一下数据结构：
             <br/>
             更新之后的maptools读入bou2_4p.shp之后，形成一个SpatialPolygonsDataFrame对象 （class(x)）.这个对象有”data”，”polygons” ，   “plotOrder”，”bbox”，”proj4string”五个slot组成（slotNames(x)）,如果想提取每个slot的数据可以通过x@slotname, slot(x,”slotname”)获得。
            </p>
            <p>
             每个slot中包含不同的内容
             <br/>
             data: 是一个data.frame, 包含925行，7列数据（”AREA” ，”PERIMETER”  “BOU2_4M_”，   “BOU2_4M_ID”， “ADCODE93″，   “ADCODE99” ，  “NAME”），而最重要的各个省市的名称就在NAME这一列中。
             <br/>
             plotOrder,是一个长度925的vector
            </p>
            <p>
             bbox是一个2×2的矩阵，包含x,y值的最大和最小值
            </p>
            <p>
             proj4string 在该数据情况下没有值（NA）
            </p>
            <p>
             polygons: 它的情况比较复杂，本身是一个list, 长度925， 其中每个元素又为一个polygons对象，又有几层结构：
             <br/>
             $ :Formal class ‘Polygons’ [package “sp”] with 5 slots
             <br/>
             .. ..@ Polygons :List of 1
             <br/>
             .. .. ..$ :Formal class ‘Polygon’ [package “sp”] with 5 slots
             <br/>
             .. .. .. .. ..@ labpt  : num [1:2] 114.3 22.2
             <br/>
             .. .. .. .. ..@ area   : num 8.6e-06
             <br/>
             .. .. .. .. ..@ hole   : logi FALSE
             <br/>
             .. .. .. .. ..@ ringDir: int 1
             <br/>
             .. .. .. .. ..@ coords : num [1:9, 1:2] 114 114 114 114 114 …
             <br/>
             .. ..@ plotOrder: int 1
             <br/>
             .. ..@ labpt    : num [1:2] 114.3 22.2
             <br/>
             .. ..@ ID       : chr “924”
             <br/>
             .. ..@ area     : num 8.6e-06
            </p>
            <p>
             具体内容还没有彻底弄明白！
            </p>
            <p>
             现在这个数据的主要局限是没有办法在英文系统下使用，或者没有办法以各个省的拼音名称进行索引和赋值。所以我想 把NAME 部分的中文名称改为拼音（这个不难实现），之后不知道有谁知道如何把修改后的数据输出保存到一个新的shp文件中？或者把这个修改后的SpatialPolygonsDataFrame对象直接保存为data, 然后就可以在英文系统上操作了！
             <br/>
             请多帮忙！
             <br/>
             ps：留言时候的那个认证太难了，失败了几次才成！！
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给zwdbordeaux" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=1707#respond" onclick='return addComment.moveForm( "div-comment-1707", "1707", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
          <ol class="children">
           <li class="comment byuser comment-author-yixuanq bypostauthor even depth-2 parent" id="comment-1708">
            <article class="comment-body" id="div-comment-1708">
             <footer class="comment-meta">
              <div class="comment-author vcard">
               <img src="http://sdn.geekzu.org/avatar/f09663fd5fc04bad5e5b09daddb86fe6?s=74&amp;d=monsterid&amp;r=g"/>
               <b class="fn">
                邱怡轩
               </b>
               <span class="says">
                说道：
               </span>
              </div>
              <!-- .comment-author -->
              <div class="comment-metadata">
               <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-1708">
                <time datetime="2010-11-11T12:00:56+00:00">
                 2010/11/11 12:00
                </time>
               </a>
              </div>
              <!-- .comment-metadata -->
             </footer>
             <!-- .comment-meta -->
             <div class="comment-content">
              <p>
               读写shapefile应该可以借助一些第三方的工具，我大概搜了一下，似乎有很多OpenGIS什么的开源软件，应该可以做到吧。
              </p>
             </div>
             <!-- .comment-content -->
             <div class="reply">
              <a aria-label="回复给邱怡轩" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=1708#respond" onclick='return addComment.moveForm( "div-comment-1708", "1708", "respond", "1335" )' rel="nofollow">
               回复
              </a>
             </div>
            </article>
            <!-- .comment-body -->
            <ol class="children">
             <li class="comment odd alt depth-3" id="comment-1709">
              <article class="comment-body" id="div-comment-1709">
               <footer class="comment-meta">
                <div class="comment-author vcard">
                 <img src="http://sdn.geekzu.org/avatar/6b96a772d9ef16d4cb49fe35c8f5da10?s=74&amp;d=monsterid&amp;r=g"/>
                 <b class="fn">
                  zwdbordeaux
                 </b>
                 <span class="says">
                  说道：
                 </span>
                </div>
                <!-- .comment-author -->
                <div class="comment-metadata">
                 <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-1709">
                  <time datetime="2010-11-12T06:39:01+00:00">
                   2010/11/12 06:39
                  </time>
                 </a>
                </div>
                <!-- .comment-metadata -->
               </footer>
               <!-- .comment-meta -->
               <div class="comment-content">
                <p>
                 多谢！
                 <br/>
                 这个问题已经通过maptools包中的
                 <br/>
                 writePolyShape()搞定！
                </p>
                <p>
                 此外，对于画某些特定省份的问题可以如下解决：
                 <br/>
                 plot(y[y$NAME%in%provname,],col=”green”,border=”black”)
                </p>
               </div>
               <!-- .comment-content -->
              </article>
              <!-- .comment-body -->
             </li>
             <!-- #comment-## -->
            </ol>
            <!-- .children -->
           </li>
           <!-- #comment-## -->
          </ol>
          <!-- .children -->
         </li>
         <!-- #comment-## -->
         <li class="comment even thread-even depth-1" id="comment-1767">
          <article class="comment-body" id="div-comment-1767">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/020387b1ff3e13a03284b8145ed80dbc?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              <a class="url" href="http://按四位数邮政编码分区的中国地图" rel="external nofollow">
               Waste
              </a>
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-1767">
              <time datetime="2010-11-30T22:06:28+00:00">
               2010/11/30 22:06
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             请问用R能不能画出按四位数邮政编码分区的中国地图
             <br/>
             每一地区按照资料而有不同颜色
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给Waste" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=1767#respond" onclick='return addComment.moveForm( "div-comment-1767", "1767", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
         </li>
         <!-- #comment-## -->
         <li class="comment odd alt thread-odd thread-alt depth-1 parent" id="comment-1778">
          <article class="comment-body" id="div-comment-1778">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/f7ce720681e5aeeae07ded56074da1c5?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              孟长河
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-1778">
              <time datetime="2010-12-13T16:52:39+00:00">
               2010/12/13 16:52
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             将这三个文件解压到同一个目录下？可以直接把这三个文件放在桌面上的文件夹里吗？还是要放在特定程序包里面？
            </p>
            <p>
             我用x=readShapePoly(‘bou2_4p.shp’)，然后出来的结果是：Error in getinfo.shape(filen) : Error opening SHP file，求解答，先谢了
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给孟长河" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=1778#respond" onclick='return addComment.moveForm( "div-comment-1778", "1778", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
          <ol class="children">
           <li class="comment byuser comment-author-yixuanq bypostauthor even depth-2 parent" id="comment-1779">
            <article class="comment-body" id="div-comment-1779">
             <footer class="comment-meta">
              <div class="comment-author vcard">
               <img src="http://sdn.geekzu.org/avatar/f09663fd5fc04bad5e5b09daddb86fe6?s=74&amp;d=monsterid&amp;r=g"/>
               <b class="fn">
                邱怡轩
               </b>
               <span class="says">
                说道：
               </span>
              </div>
              <!-- .comment-author -->
              <div class="comment-metadata">
               <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-1779">
                <time datetime="2010-12-13T18:02:04+00:00">
                 2010/12/13 18:02
                </time>
               </a>
              </div>
              <!-- .comment-metadata -->
             </footer>
             <!-- .comment-meta -->
             <div class="comment-content">
              <p>
               你应该是没有把R的工作目录设为文件所在的目录，见getwd()命令。
              </p>
             </div>
             <!-- .comment-content -->
             <div class="reply">
              <a aria-label="回复给邱怡轩" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=1779#respond" onclick='return addComment.moveForm( "div-comment-1779", "1779", "respond", "1335" )' rel="nofollow">
               回复
              </a>
             </div>
            </article>
            <!-- .comment-body -->
            <ol class="children">
             <li class="comment odd alt depth-3 parent" id="comment-1781">
              <article class="comment-body" id="div-comment-1781">
               <footer class="comment-meta">
                <div class="comment-author vcard">
                 <img src="http://sdn.geekzu.org/avatar/f7ce720681e5aeeae07ded56074da1c5?s=74&amp;d=monsterid&amp;r=g"/>
                 <b class="fn">
                  孟长河
                 </b>
                 <span class="says">
                  说道：
                 </span>
                </div>
                <!-- .comment-author -->
                <div class="comment-metadata">
                 <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-1781">
                  <time datetime="2010-12-14T10:49:10+00:00">
                   2010/12/14 10:49
                  </time>
                 </a>
                </div>
                <!-- .comment-metadata -->
               </footer>
               <!-- .comment-meta -->
               <div class="comment-content">
                <p>
                 谢谢，果然有用了~   我现在是把china-province-border-data.tar这个文件夹里的东西拷到R的bin（即getwd（）所在文件）文件里了，是这样的意思吗？
                </p>
               </div>
               <!-- .comment-content -->
              </article>
              <!-- .comment-body -->
             </li>
             <!-- #comment-## -->
             <li class="comment byuser comment-author-yixuanq bypostauthor even depth-3" id="comment-1783">
              <article class="comment-body" id="div-comment-1783">
               <footer class="comment-meta">
                <div class="comment-author vcard">
                 <img src="http://sdn.geekzu.org/avatar/f09663fd5fc04bad5e5b09daddb86fe6?s=74&amp;d=monsterid&amp;r=g"/>
                 <b class="fn">
                  邱怡轩
                 </b>
                 <span class="says">
                  说道：
                 </span>
                </div>
                <!-- .comment-author -->
                <div class="comment-metadata">
                 <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-1783">
                  <time datetime="2010-12-14T12:22:48+00:00">
                   2010/12/14 12:22
                  </time>
                 </a>
                </div>
                <!-- .comment-metadata -->
               </footer>
               <!-- .comment-meta -->
               <div class="comment-content">
                <p>
                 我之前其实说得还不准确，
                 <code>
                  getwd()
                 </code>
                 是获取工作目录，事实上R是可以自己设定工作目录的，相应的命令是
                 <code>
                  setwd()
                 </code>
                 ，里面加上三个文件所在的目录就行了，比如
                 <code>
                  setwd("D:\\work")
                 </code>
                 ，表达反斜杠的时候要写两个。
                </p>
               </div>
               <!-- .comment-content -->
              </article>
              <!-- .comment-body -->
             </li>
             <!-- #comment-## -->
            </ol>
            <!-- .children -->
           </li>
           <!-- #comment-## -->
          </ol>
          <!-- .children -->
         </li>
         <!-- #comment-## -->
         <li class="comment odd alt thread-even depth-1" id="comment-1832">
          <article class="comment-body" id="div-comment-1832">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/a0974731fb1ca22ea0fb104902bce657?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              sociology
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-1832">
              <time datetime="2011-01-05T10:08:12+00:00">
               2011/01/05 10:08
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             有没有人知道某个省的各个区，甚至更小地理单位的GIS地图那里找得到？
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给sociology" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=1832#respond" onclick='return addComment.moveForm( "div-comment-1832", "1832", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
         </li>
         <!-- #comment-## -->
         <li class="comment even thread-odd thread-alt depth-1" id="comment-1957">
          <article class="comment-body" id="div-comment-1957">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/b4ade9b6c738c92dddcd4df09e39b03b?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              <a class="url" href="http://saslist.com" rel="external nofollow">
               sxlion
              </a>
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-1957">
              <time datetime="2011-04-03T07:03:42+00:00">
               2011/04/03 07:03
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             用SAS吧，轻松绘制。
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给sxlion" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=1957#respond" onclick='return addComment.moveForm( "div-comment-1957", "1957", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
         </li>
         <!-- #comment-## -->
         <li class="comment odd alt thread-even depth-1 parent" id="comment-1992">
          <article class="comment-body" id="div-comment-1992">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/bde74878f1dce1dda6199d63ecc5684b?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              zimu0124
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-1992">
              <time datetime="2011-04-26T15:15:20+00:00">
               2011/04/26 15:15
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             请教老师：
            </p>
            <p>
             执行了
            </p>
            <pre class="brush: r">&gt; provname=c("北京市","天津市")
&gt; provcol=c("red","green")
&gt; plot(x,col=getColor(x,provname,provcol,"white"))</pre>
            <p>
             但是提示错误: 类别为’closure’的对象不可以取子集
            </p>
            <p>
             为什么呢？
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给zimu0124" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=1992#respond" onclick='return addComment.moveForm( "div-comment-1992", "1992", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
          <ol class="children">
           <li class="comment byuser comment-author-yihui even depth-2 parent" id="comment-1997">
            <article class="comment-body" id="div-comment-1997">
             <footer class="comment-meta">
              <div class="comment-author vcard">
               <img src="http://sdn.geekzu.org/avatar/1022d8e6ebc94e8f6bca9a86cebe312a?s=74&amp;d=monsterid&amp;r=g"/>
               <b class="fn">
                <a class="url" href="http://yihui.name" rel="external nofollow">
                 谢益辉
                </a>
               </b>
               <span class="says">
                说道：
               </span>
              </div>
              <!-- .comment-author -->
              <div class="comment-metadata">
               <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-1997">
                <time datetime="2011-04-27T13:01:46+00:00">
                 2011/04/27 13:01
                </time>
               </a>
              </div>
              <!-- .comment-metadata -->
             </footer>
             <!-- .comment-meta -->
             <div class="comment-content">
              <p>
               把你的str(x)和traceback()打印出来看看。
              </p>
             </div>
             <!-- .comment-content -->
             <div class="reply">
              <a aria-label="回复给谢益辉" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=1997#respond" onclick='return addComment.moveForm( "div-comment-1997", "1997", "respond", "1335" )' rel="nofollow">
               回复
              </a>
             </div>
            </article>
            <!-- .comment-body -->
            <ol class="children">
             <li class="comment odd alt depth-3" id="comment-2534">
              <article class="comment-body" id="div-comment-2534">
               <footer class="comment-meta">
                <div class="comment-author vcard">
                 <img src="http://sdn.geekzu.org/avatar/6595e25d221f6469a95948806bd56adc?s=74&amp;d=monsterid&amp;r=g"/>
                 <b class="fn">
                  joey
                 </b>
                 <span class="says">
                  说道：
                 </span>
                </div>
                <!-- .comment-author -->
                <div class="comment-metadata">
                 <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-2534">
                  <time datetime="2011-11-04T14:49:40+00:00">
                   2011/11/04 14:49
                  </time>
                 </a>
                </div>
                <!-- .comment-metadata -->
               </footer>
               <!-- .comment-meta -->
               <div class="comment-content">
                <p>
                 最大的问题是x@data结果的925行和33行name都完全乱码,可能是R识别不了中文所致? 用的MAC版本.谢谢!
                </p>
               </div>
               <!-- .comment-content -->
              </article>
              <!-- .comment-body -->
             </li>
             <!-- #comment-## -->
            </ol>
            <!-- .children -->
           </li>
           <!-- #comment-## -->
          </ol>
          <!-- .children -->
         </li>
         <!-- #comment-## -->
         <li class="comment even thread-odd thread-alt depth-1" id="comment-2106">
          <article class="comment-body" id="div-comment-2106">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/1855c899f9d9a005f17a11cb1cc2dcbc?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              huangziwei
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-2106">
              <time datetime="2011-05-14T14:18:47+00:00">
               2011/05/14 14:18
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             对SpatialPolygonsDataFrame这个东西搞不懂。希望有更多参考资料。
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给huangziwei" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=2106#respond" onclick='return addComment.moveForm( "div-comment-2106", "2106", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
         </li>
         <!-- #comment-## -->
         <li class="pingback odd alt thread-even depth-1" id="comment-2236">
          <div class="comment-body">
           Pingback：
           <a class="url" href="http://www.loyhome.com/%e7%94%a8r%e7%94%bb%ef%bc%88%e4%b8%ad%e5%9b%bd%ef%bc%89%e5%9c%b0%e5%9b%be/" rel="external nofollow">
            落园 » 用R画（中国）地图|专注经济视角下的互联网
           </a>
          </div>
         </li>
         <!-- #comment-## -->
         <li class="comment even thread-odd thread-alt depth-1" id="comment-2307">
          <article class="comment-body" id="div-comment-2307">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/e6d4440533bb73cc1066e076a7930206?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              alpha-beta
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-2307">
              <time datetime="2011-07-20T12:58:11+00:00">
               2011/07/20 12:58
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             再激动感叹号也不能超过三个！：）呵呵。。。
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给alpha-beta" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=2307#respond" onclick='return addComment.moveForm( "div-comment-2307", "2307", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
         </li>
         <!-- #comment-## -->
         <li class="comment odd alt thread-even depth-1 parent" id="comment-2310">
          <article class="comment-body" id="div-comment-2310">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/f7ce720681e5aeeae07ded56074da1c5?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              孟长河
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-2310">
              <time datetime="2011-07-23T09:54:00+00:00">
               2011/07/23 09:54
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             getColor这个函数是不是也不行了？
             <br/>
             我试了着色不上了……
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给孟长河" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=2310#respond" onclick='return addComment.moveForm( "div-comment-2310", "2310", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
          <ol class="children">
           <li class="comment even depth-2" id="comment-2325">
            <article class="comment-body" id="div-comment-2325">
             <footer class="comment-meta">
              <div class="comment-author vcard">
               <img src="http://sdn.geekzu.org/avatar/5a7744520e02524b95a0872a07570980?s=74&amp;d=monsterid&amp;r=g"/>
               <b class="fn">
                路人甲
               </b>
               <span class="says">
                说道：
               </span>
              </div>
              <!-- .comment-author -->
              <div class="comment-metadata">
               <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-2325">
                <time datetime="2011-08-01T11:49:41+00:00">
                 2011/08/01 11:49
                </time>
               </a>
              </div>
              <!-- .comment-metadata -->
             </footer>
             <!-- .comment-meta -->
             <div class="comment-content">
              <p>
               getColor是板主自寫的 煩請詳讀點好嗎
              </p>
             </div>
             <!-- .comment-content -->
             <div class="reply">
              <a aria-label="回复给路人甲" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=2325#respond" onclick='return addComment.moveForm( "div-comment-2325", "2325", "respond", "1335" )' rel="nofollow">
               回复
              </a>
             </div>
            </article>
            <!-- .comment-body -->
           </li>
           <!-- #comment-## -->
           <li class="comment odd alt depth-2" id="comment-3803">
            <article class="comment-body" id="div-comment-3803">
             <footer class="comment-meta">
              <div class="comment-author vcard">
               <img src="http://sdn.geekzu.org/avatar/57ea82fe4c47550e7b668ec258d270bc?s=74&amp;d=monsterid&amp;r=g"/>
               <b class="fn">
                XAVIER
               </b>
               <span class="says">
                说道：
               </span>
              </div>
              <!-- .comment-author -->
              <div class="comment-metadata">
               <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-3803">
                <time datetime="2013-03-11T15:02:45+00:00">
                 2013/03/11 15:02
                </time>
               </a>
              </div>
              <!-- .comment-metadata -->
             </footer>
             <!-- .comment-meta -->
             <div class="comment-content">
              <p>
               需要做些修改
               <br/>
               colIndex=sapply(mapdata$att.data$NAME,f,provname);
               <br/>
               改成
               <br/>
               colIndex=sapply(mapdata$NAME,f,provname);
              </p>
             </div>
             <!-- .comment-content -->
             <div class="reply">
              <a aria-label="回复给XAVIER" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=3803#respond" onclick='return addComment.moveForm( "div-comment-3803", "3803", "respond", "1335" )' rel="nofollow">
               回复
              </a>
             </div>
            </article>
            <!-- .comment-body -->
           </li>
           <!-- #comment-## -->
          </ol>
          <!-- .children -->
         </li>
         <!-- #comment-## -->
         <li class="comment even thread-odd thread-alt depth-1" id="comment-2436">
          <article class="comment-body" id="div-comment-2436">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/a964793687fbcbe5e3150ed6858afd95?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              Lisa
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-2436">
              <time datetime="2011-09-13T17:21:46+00:00">
               2011/09/13 17:21
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             我们用GIS做，但是美中不足，就是总是画不出美丽的画。这是天赋问题么
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给Lisa" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=2436#respond" onclick='return addComment.moveForm( "div-comment-2436", "2436", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
         </li>
         <!-- #comment-## -->
         <li class="comment odd alt thread-even depth-1" id="comment-2525">
          <article class="comment-body" id="div-comment-2525">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/77599c847762d2a105103f2c716a13f7?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              <a class="url" href="http://blog.sina.com.cn/chrisalken" rel="external nofollow">
               秦保立
              </a>
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-2525">
              <time datetime="2011-10-30T22:31:30+00:00">
               2011/10/30 22:31
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             以前曾经画过这类图，没有用上述统计包，具体思路是这样的：
             <br/>
             （1）准备要画的底图，用别的计算机语言编程（或许R语言也有类似的包吧），提取出需要的底图区域的像素值，并保存到数据库中；
             <br/>
             （2）在R中，按照提取的底图的比例建立绘图区（如果比例不一致，可能会变形），读取数据库中保存的像素值并绘制出来；
             <br/>
             （3）在底图上绘制需要的图形。
             <br/>
             这样不仅可以画分省的，还可以画一个市的、一个县的。。。随你怎么画。
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给秦保立" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=2525#respond" onclick='return addComment.moveForm( "div-comment-2525", "2525", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
         </li>
         <!-- #comment-## -->
         <li class="comment even thread-odd thread-alt depth-1 parent" id="comment-2607">
          <article class="comment-body" id="div-comment-2607">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/ba11239f797766ab121026dd6c35acbb?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              张无忌
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-2607">
              <time datetime="2011-11-28T14:55:11+00:00">
               2011/11/28 14:55
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             我想问一下地图绘制出来之后希望添加一个colorbar用以表示不同的数值，如何添加？谢谢！
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给张无忌" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=2607#respond" onclick='return addComment.moveForm( "div-comment-2607", "2607", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
          <ol class="children">
           <li class="comment odd alt depth-2" id="comment-6458">
            <article class="comment-body" id="div-comment-6458">
             <footer class="comment-meta">
              <div class="comment-author vcard">
               <img src="http://sdn.geekzu.org/avatar/a64bca1d8f928f9fe930bcc45ef3d752?s=74&amp;d=monsterid&amp;r=g"/>
               <b class="fn">
                xuduo
               </b>
               <span class="says">
                说道：
               </span>
              </div>
              <!-- .comment-author -->
              <div class="comment-metadata">
               <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-6458">
                <time datetime="2014-12-19T12:37:23+00:00">
                 2014/12/19 12:37
                </time>
               </a>
              </div>
              <!-- .comment-metadata -->
             </footer>
             <!-- .comment-meta -->
             <div class="comment-content">
              <p>
               你好，请问你这个问题解决了吗
              </p>
             </div>
             <!-- .comment-content -->
             <div class="reply">
              <a aria-label="回复给xuduo" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=6458#respond" onclick='return addComment.moveForm( "div-comment-6458", "6458", "respond", "1335" )' rel="nofollow">
               回复
              </a>
             </div>
            </article>
            <!-- .comment-body -->
           </li>
           <!-- #comment-## -->
          </ol>
          <!-- .children -->
         </li>
         <!-- #comment-## -->
         <li class="comment even thread-even depth-1" id="comment-3053">
          <article class="comment-body" id="div-comment-3053">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/cfc35bba4985f54c89a3239a8efe0af5?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              吕小忠
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-3053">
              <time datetime="2012-05-11T10:40:05+00:00">
               2012/05/11 10:40
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             请问能不能在部分省份上标注该省的环境信息如：海拔、年平均气温、年均降水量、年平均光照强度、水质溶氧量、PH值、平均水温、河床比降、水流速、矿化度、硬度等信息，我要做一个物种在各省的分布情况及该省的环境参数，该怎么实现，谢谢
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给吕小忠" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=3053#respond" onclick='return addComment.moveForm( "div-comment-3053", "3053", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
         </li>
         <!-- #comment-## -->
         <li class="comment odd alt thread-odd thread-alt depth-1" id="comment-3243">
          <article class="comment-body" id="div-comment-3243">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/fe29376d9573a80d2bd3822469df010b?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              <a class="url" href="http://ximuing.com" rel="external nofollow">
               西木
              </a>
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-3243">
              <time datetime="2012-07-26T23:52:53+00:00">
               2012/07/26 23:52
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             非常感谢这篇文章！如果数据更多，比如在一个excel表格里，如何把这个excel和R的地图功能联系在一起，划出这种类似你文章里人口的density 图呢？谢了
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给西木" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=3243#respond" onclick='return addComment.moveForm( "div-comment-3243", "3243", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
         </li>
         <!-- #comment-## -->
         <li class="comment even thread-even depth-1" id="comment-3514">
          <article class="comment-body" id="div-comment-3514">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/b11bcc00be714a30fe3d1f4bc80acc2a?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              sharp
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-3514">
              <time datetime="2012-12-17T09:13:42+00:00">
               2012/12/17 09:13
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             这个软件可以自己画一个局部的地图吗（比如一个县）？可以自己添加城市吗？
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给sharp" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=3514#respond" onclick='return addComment.moveForm( "div-comment-3514", "3514", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
         </li>
         <!-- #comment-## -->
         <li class="comment odd alt thread-odd thread-alt depth-1" id="comment-3529">
          <article class="comment-body" id="div-comment-3529">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/34305adee3667dbc991b67726c4bd700?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              qing
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-3529">
              <time datetime="2012-12-19T16:17:00+00:00">
               2012/12/19 16:17
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             对于我这种似懂非懂的人来说，写得太详细了。
             <br/>
             太好了，非常感谢。
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给qing" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=3529#respond" onclick='return addComment.moveForm( "div-comment-3529", "3529", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
         </li>
         <!-- #comment-## -->
         <li class="pingback even thread-even depth-1" id="comment-3555">
          <div class="comment-body">
           Pingback：
           <a class="url" href="http://cos.name/2013/01/drawing-map-in-r-era/" rel="external nofollow">
            R时代，你要怎样画地图？ | 统计之都
           </a>
          </div>
         </li>
         <!-- #comment-## -->
         <li class="pingback odd alt thread-odd thread-alt depth-1" id="comment-3856">
          <div class="comment-body">
           Pingback：
           <a class="url" href="http://blog.programet.org/2013/03/%e5%9c%a8r%e4%b8%ad%e4%bd%bf%e7%94%a8ggplot2%e7%94%bb%e5%9c%b0%e5%9b%be.html" rel="external nofollow">
            在R中使用ggplot2画地图 | f(Program,Poet)=Programet
           </a>
          </div>
         </li>
         <!-- #comment-## -->
         <li class="comment even thread-even depth-1 parent" id="comment-3925">
          <article class="comment-body" id="div-comment-3925">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/60847858990a1e8db8196b8fd888bfe8?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              <a class="url" href="http://nomaptoolsfound" rel="external nofollow">
               Tilly
              </a>
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-3925">
              <time datetime="2013-04-07T07:40:15+00:00">
               2013/04/07 07:40
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             i was going to use it to get Australian map, somehow there is no maptools in my latest version R. can anyone please offer me some help?
            </p>
            <p>
             cheers.
             <br/>
             tilly
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给Tilly" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=3925#respond" onclick='return addComment.moveForm( "div-comment-3925", "3925", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
          <ol class="children">
           <li class="comment byuser comment-author-yixuanq bypostauthor odd alt depth-2 parent" id="comment-3926">
            <article class="comment-body" id="div-comment-3926">
             <footer class="comment-meta">
              <div class="comment-author vcard">
               <img src="http://sdn.geekzu.org/avatar/f09663fd5fc04bad5e5b09daddb86fe6?s=74&amp;d=monsterid&amp;r=g"/>
               <b class="fn">
                <a class="url" href="http://yixuan.cos.name/cn" rel="external nofollow">
                 邱怡轩
                </a>
               </b>
               <span class="says">
                说道：
               </span>
              </div>
              <!-- .comment-author -->
              <div class="comment-metadata">
               <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-3926">
                <time datetime="2013-04-07T08:40:56+00:00">
                 2013/04/07 08:40
                </time>
               </a>
              </div>
              <!-- .comment-metadata -->
             </footer>
             <!-- .comment-meta -->
             <div class="comment-content">
              <p>
               1. Do you have the shapefile(*.shp) of Australian map?
               <br/>
               2. Have you installed maptools package in R? Try
               <code>
                install.packages("maptools")
               </code>
               ?
              </p>
             </div>
             <!-- .comment-content -->
             <div class="reply">
              <a aria-label="回复给邱怡轩" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=3926#respond" onclick='return addComment.moveForm( "div-comment-3926", "3926", "respond", "1335" )' rel="nofollow">
               回复
              </a>
             </div>
            </article>
            <!-- .comment-body -->
            <ol class="children">
             <li class="comment even depth-3" id="comment-3929">
              <article class="comment-body" id="div-comment-3929">
               <footer class="comment-meta">
                <div class="comment-author vcard">
                 <img src="http://sdn.geekzu.org/avatar/60847858990a1e8db8196b8fd888bfe8?s=74&amp;d=monsterid&amp;r=g"/>
                 <b class="fn">
                  <a class="url" href="http://nomaptoolsfound" rel="external nofollow">
                   Tilly
                  </a>
                 </b>
                 <span class="says">
                  说道：
                 </span>
                </div>
                <!-- .comment-author -->
                <div class="comment-metadata">
                 <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-3929">
                  <time datetime="2013-04-07T18:19:47+00:00">
                   2013/04/07 18:19
                  </time>
                 </a>
                </div>
                <!-- .comment-metadata -->
               </footer>
               <!-- .comment-meta -->
               <div class="comment-content">
                <p>
                 hi, 邱怡轩,
                 <br/>
                 Yes, i have, i have successfully loaded shx file of Australian map:
                </p>
                <pre>&gt; getColor=function(mapdata,provname,provcol,othercol)
+ {
+     f=function(x,y) ifelse(x %in% y,which(y==x),0);
+     colIndex=sapply(mapdata$att.data$NAME,f,provname);
+     col=c(othercol,provcol)[colIndex+1];
+     return(col);
+ }
&gt; 
&gt; 
&gt; provname=c("Canberra")
&gt; provcol=c("red")
&gt; plot(ozDATA,col=getColor(ozDATA,provname,provcol,"White"))
Error in colIndex + 1 : non-numeric argument to binary operator
</pre>
                <p>
                 see the Error msg above, why is that?
                </p>
               </div>
               <!-- .comment-content -->
              </article>
              <!-- .comment-body -->
             </li>
             <!-- #comment-## -->
            </ol>
            <!-- .children -->
           </li>
           <!-- #comment-## -->
           <li class="comment byuser comment-author-yixuanq bypostauthor odd alt depth-2 parent" id="comment-3933">
            <article class="comment-body" id="div-comment-3933">
             <footer class="comment-meta">
              <div class="comment-author vcard">
               <img src="http://sdn.geekzu.org/avatar/f09663fd5fc04bad5e5b09daddb86fe6?s=74&amp;d=monsterid&amp;r=g"/>
               <b class="fn">
                <a class="url" href="http://yixuan.cos.name/cn" rel="external nofollow">
                 邱怡轩
                </a>
               </b>
               <span class="says">
                说道：
               </span>
              </div>
              <!-- .comment-author -->
              <div class="comment-metadata">
               <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-3933">
                <time datetime="2013-04-08T05:37:56+00:00">
                 2013/04/08 05:37
                </time>
               </a>
              </div>
              <!-- .comment-metadata -->
             </footer>
             <!-- .comment-meta -->
             <div class="comment-content">
              <p>
               As I mentioned in the article, some functions have been changed with the new version of maptools package, and your code should be modified as
              </p>
              <pre>&gt; getColor=function(mapdata,provname,provcol,othercol)
+ {
+     f=function(x,y) ifelse(x %in% y,which(y==x),0);
+     colIndex=sapply(mapdata@data$NAME,f,provname);
+     col=c(othercol,provcol)[colIndex+1];
+     return(col);
+ }
&gt; provname=c("Canberra")
&gt; provcol=c("red")
&gt; plot(ozDATA,col=getColor(ozDATA,provname,provcol,"White"))
</pre>
              <p>
               Hope this works for you.
              </p>
             </div>
             <!-- .comment-content -->
             <div class="reply">
              <a aria-label="回复给邱怡轩" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=3933#respond" onclick='return addComment.moveForm( "div-comment-3933", "3933", "respond", "1335" )' rel="nofollow">
               回复
              </a>
             </div>
            </article>
            <!-- .comment-body -->
            <ol class="children">
             <li class="comment even depth-3" id="comment-3938">
              <article class="comment-body" id="div-comment-3938">
               <footer class="comment-meta">
                <div class="comment-author vcard">
                 <img src="http://sdn.geekzu.org/avatar/60847858990a1e8db8196b8fd888bfe8?s=74&amp;d=monsterid&amp;r=g"/>
                 <b class="fn">
                  <a class="url" href="http://nomaptoolsfound" rel="external nofollow">
                   Tilly
                  </a>
                 </b>
                 <span class="says">
                  说道：
                 </span>
                </div>
                <!-- .comment-author -->
                <div class="comment-metadata">
                 <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-3938">
                  <time datetime="2013-04-08T17:59:43+00:00">
                   2013/04/08 17:59
                  </time>
                 </a>
                </div>
                <!-- .comment-metadata -->
               </footer>
               <!-- .comment-meta -->
               <div class="comment-content">
                <p>
                 hi, 邱怡轩,
                </p>
                <p>
                 after ran second slot, below is the error msg i have got.
                </p>
                <p>
                 Error: unexpected ‘}’ in:
                 <br/>
                 ”        +     return(col);
                 <br/>
                 + }”
                </p>
                <p>
                 Sorry for being a pain.
                </p>
                <p>
                 Cheers,
                 <br/>
                 Tilly
                </p>
               </div>
               <!-- .comment-content -->
              </article>
              <!-- .comment-body -->
             </li>
             <!-- #comment-## -->
            </ol>
            <!-- .children -->
           </li>
           <!-- #comment-## -->
           <li class="comment byuser comment-author-yixuanq bypostauthor odd alt depth-2" id="comment-3941">
            <article class="comment-body" id="div-comment-3941">
             <footer class="comment-meta">
              <div class="comment-author vcard">
               <img src="http://sdn.geekzu.org/avatar/f09663fd5fc04bad5e5b09daddb86fe6?s=74&amp;d=monsterid&amp;r=g"/>
               <b class="fn">
                <a class="url" href="http://yixuan.cos.name/cn" rel="external nofollow">
                 邱怡轩
                </a>
               </b>
               <span class="says">
                说道：
               </span>
              </div>
              <!-- .comment-author -->
              <div class="comment-metadata">
               <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-3941">
                <time datetime="2013-04-08T22:13:07+00:00">
                 2013/04/08 22:13
                </time>
               </a>
              </div>
              <!-- .comment-metadata -->
             </footer>
             <!-- .comment-meta -->
             <div class="comment-content">
              <p>
               Seems like you copied the plus sign into R also. Remove “+” in the beginning of each line.
              </p>
             </div>
             <!-- .comment-content -->
             <div class="reply">
              <a aria-label="回复给邱怡轩" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=3941#respond" onclick='return addComment.moveForm( "div-comment-3941", "3941", "respond", "1335" )' rel="nofollow">
               回复
              </a>
             </div>
            </article>
            <!-- .comment-body -->
           </li>
           <!-- #comment-## -->
          </ol>
          <!-- .children -->
         </li>
         <!-- #comment-## -->
         <li class="comment even thread-odd thread-alt depth-1 parent" id="comment-3969">
          <article class="comment-body" id="div-comment-3969">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/305ce2cec9ce241ef4bbc04b73736564?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              Green
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-3969">
              <time datetime="2013-04-11T23:16:10+00:00">
               2013/04/11 23:16
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             如何安装maptools啊?
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给Green" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=3969#respond" onclick='return addComment.moveForm( "div-comment-3969", "3969", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
          <ol class="children">
           <li class="comment byuser comment-author-yixuanq bypostauthor odd alt depth-2" id="comment-3971">
            <article class="comment-body" id="div-comment-3971">
             <footer class="comment-meta">
              <div class="comment-author vcard">
               <img src="http://sdn.geekzu.org/avatar/f09663fd5fc04bad5e5b09daddb86fe6?s=74&amp;d=monsterid&amp;r=g"/>
               <b class="fn">
                <a class="url" href="http://yixuan.cos.name/cn" rel="external nofollow">
                 邱怡轩
                </a>
               </b>
               <span class="says">
                说道：
               </span>
              </div>
              <!-- .comment-author -->
              <div class="comment-metadata">
               <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-3971">
                <time datetime="2013-04-12T04:45:09+00:00">
                 2013/04/12 04:45
                </time>
               </a>
              </div>
              <!-- .comment-metadata -->
             </footer>
             <!-- .comment-meta -->
             <div class="comment-content">
              <p>
               <code>
                install.packages("maptools")
               </code>
              </p>
             </div>
             <!-- .comment-content -->
             <div class="reply">
              <a aria-label="回复给邱怡轩" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=3971#respond" onclick='return addComment.moveForm( "div-comment-3971", "3971", "respond", "1335" )' rel="nofollow">
               回复
              </a>
             </div>
            </article>
            <!-- .comment-body -->
           </li>
           <!-- #comment-## -->
          </ol>
          <!-- .children -->
         </li>
         <!-- #comment-## -->
         <li class="comment even thread-even depth-1" id="comment-4101">
          <article class="comment-body" id="div-comment-4101">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/e00129bc95271e0dd52cfb8688dd2cf7?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              wangpeng692
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-4101">
              <time datetime="2013-04-27T15:15:58+00:00">
               2013/04/27 15:15
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             学习了，很强大。
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给wangpeng692" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=4101#respond" onclick='return addComment.moveForm( "div-comment-4101", "4101", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
         </li>
         <!-- #comment-## -->
         <li class="comment odd alt thread-odd thread-alt depth-1 parent" id="comment-4160">
          <article class="comment-body" id="div-comment-4160">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/616596e51d5e3d103e40aad2231fc34b?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              张丽霞
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-4160">
              <time datetime="2013-05-04T22:48:45+00:00">
               2013/05/04 22:48
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             R画世界地图的话，数据去哪找呢？
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给张丽霞" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=4160#respond" onclick='return addComment.moveForm( "div-comment-4160", "4160", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
          <ol class="children">
           <li class="comment even depth-2" id="comment-4280">
            <article class="comment-body" id="div-comment-4280">
             <footer class="comment-meta">
              <div class="comment-author vcard">
               <img src="http://sdn.geekzu.org/avatar/078c951c0276bbedd3b777d6e3e6fee4?s=74&amp;d=monsterid&amp;r=g"/>
               <b class="fn">
                joey
               </b>
               <span class="says">
                说道：
               </span>
              </div>
              <!-- .comment-author -->
              <div class="comment-metadata">
               <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-4280">
                <time datetime="2013-05-28T10:14:37+00:00">
                 2013/05/28 10:14
                </time>
               </a>
              </div>
              <!-- .comment-metadata -->
             </footer>
             <!-- .comment-meta -->
             <div class="comment-content">
              <p>
               map(“world”)就可以了
              </p>
             </div>
             <!-- .comment-content -->
             <div class="reply">
              <a aria-label="回复给joey" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=4280#respond" onclick='return addComment.moveForm( "div-comment-4280", "4280", "respond", "1335" )' rel="nofollow">
               回复
              </a>
             </div>
            </article>
            <!-- .comment-body -->
           </li>
           <!-- #comment-## -->
          </ol>
          <!-- .children -->
         </li>
         <!-- #comment-## -->
         <li class="comment odd alt thread-even depth-1 parent" id="comment-4222">
          <article class="comment-body" id="div-comment-4222">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/d6f494fc39401efe8aba0fbff3e57b12?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              chloe-xuan
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-4222">
              <time datetime="2013-05-17T22:18:54+00:00">
               2013/05/17 22:18
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             （bou2_4p.dbf、bou2_4p.shp和bou2_4p.shx），将这三个文件解压到同一个目录下，并在R中设好相应的工作空间
            </p>
            <p>
             你好 我还是不明白这个是怎么设相应工作空间 你能说下具体的位置吗
             <br/>
             谢谢
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给chloe-xuan" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=4222#respond" onclick='return addComment.moveForm( "div-comment-4222", "4222", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
          <ol class="children">
           <li class="comment even depth-2" id="comment-4281">
            <article class="comment-body" id="div-comment-4281">
             <footer class="comment-meta">
              <div class="comment-author vcard">
               <img src="http://sdn.geekzu.org/avatar/078c951c0276bbedd3b777d6e3e6fee4?s=74&amp;d=monsterid&amp;r=g"/>
               <b class="fn">
                joey
               </b>
               <span class="says">
                说道：
               </span>
              </div>
              <!-- .comment-author -->
              <div class="comment-metadata">
               <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-4281">
                <time datetime="2013-05-28T10:15:30+00:00">
                 2013/05/28 10:15
                </time>
               </a>
              </div>
              <!-- .comment-metadata -->
             </footer>
             <!-- .comment-meta -->
             <div class="comment-content">
              <p>
               setwd(“/your/work/directory”)
              </p>
             </div>
             <!-- .comment-content -->
             <div class="reply">
              <a aria-label="回复给joey" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=4281#respond" onclick='return addComment.moveForm( "div-comment-4281", "4281", "respond", "1335" )' rel="nofollow">
               回复
              </a>
             </div>
            </article>
            <!-- .comment-body -->
           </li>
           <!-- #comment-## -->
          </ol>
          <!-- .children -->
         </li>
         <!-- #comment-## -->
         <li class="comment odd alt thread-odd thread-alt depth-1 parent" id="comment-4282">
          <article class="comment-body" id="div-comment-4282">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/078c951c0276bbedd3b777d6e3e6fee4?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              joey
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-4282">
              <time datetime="2013-05-28T10:22:07+00:00">
               2013/05/28 10:22
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             请教两个问题：
             <br/>
             1.如何在省界的地图中加上地级市的边界。我能分别画出有省界的地图，和地级市界的线，但是不知到怎么重叠在一起，并对部分城市着色
            </p>
            <p>
             2. 如何解决在ubuntu下地图信息文件中，中文的省名不能识别乱码？ 我在win7不用设置GB2312就可以识别中文省名，但在ubuntu11.10下即使设置GB2312还是不能正常显示
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给joey" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=4282#respond" onclick='return addComment.moveForm( "div-comment-4282", "4282", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
          <ol class="children">
           <li class="comment even depth-2" id="comment-4283">
            <article class="comment-body" id="div-comment-4283">
             <footer class="comment-meta">
              <div class="comment-author vcard">
               <img src="http://sdn.geekzu.org/avatar/078c951c0276bbedd3b777d6e3e6fee4?s=74&amp;d=monsterid&amp;r=g"/>
               <b class="fn">
                joey
               </b>
               <span class="says">
                说道：
               </span>
              </div>
              <!-- .comment-author -->
              <div class="comment-metadata">
               <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-4283">
                <time datetime="2013-05-28T10:49:22+00:00">
                 2013/05/28 10:49
                </time>
               </a>
              </div>
              <!-- .comment-metadata -->
             </footer>
             <!-- .comment-meta -->
             <div class="comment-content">
              <p>
               对于中文显示问题，暂时找到一个方法
               <br/>
               将getColor函数稍作修改：colIndex=sapply(chinamap@data$NAME,f,cityname); 改为colIndex=sapply(iconv(chinamap@data$NAME,from=”CP936″, to=”UTF-8″),f,cityname);
               <br/>
               这样可以暂时显示中文省名并着色
              </p>
             </div>
             <!-- .comment-content -->
             <div class="reply">
              <a aria-label="回复给joey" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=4283#respond" onclick='return addComment.moveForm( "div-comment-4283", "4283", "respond", "1335" )' rel="nofollow">
               回复
              </a>
             </div>
            </article>
            <!-- .comment-body -->
           </li>
           <!-- #comment-## -->
          </ol>
          <!-- .children -->
         </li>
         <!-- #comment-## -->
         <li class="comment odd alt thread-even depth-1 parent" id="comment-4322">
          <article class="comment-body" id="div-comment-4322">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/8f4f2073d4346fc41db60fc1efda7e95?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              lovely32
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-4322">
              <time datetime="2013-06-03T13:51:34+00:00">
               2013/06/03 13:51
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             向您请教一个问题：我想在这幅地图上标上省名，位置尽量不重合，省名是我自己写的（北京，天津，而不是文件中的“北京市”，”天津市”），请问怎么做呢？
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给lovely32" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=4322#respond" onclick='return addComment.moveForm( "div-comment-4322", "4322", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
          <ol class="children">
           <li class="comment even depth-2" id="comment-4452">
            <article class="comment-body" id="div-comment-4452">
             <footer class="comment-meta">
              <div class="comment-author vcard">
               <img src="http://sdn.geekzu.org/avatar/078c951c0276bbedd3b777d6e3e6fee4?s=74&amp;d=monsterid&amp;r=g"/>
               <b class="fn">
                joey
               </b>
               <span class="says">
                说道：
               </span>
              </div>
              <!-- .comment-author -->
              <div class="comment-metadata">
               <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-4452">
                <time datetime="2013-06-27T10:24:09+00:00">
                 2013/06/27 10:24
                </time>
               </a>
              </div>
              <!-- .comment-metadata -->
             </footer>
             <!-- .comment-meta -->
             <div class="comment-content">
              <p>
               同问
               <br/>
               可以用正则表达式吗？？
              </p>
             </div>
             <!-- .comment-content -->
             <div class="reply">
              <a aria-label="回复给joey" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=4452#respond" onclick='return addComment.moveForm( "div-comment-4452", "4452", "respond", "1335" )' rel="nofollow">
               回复
              </a>
             </div>
            </article>
            <!-- .comment-body -->
           </li>
           <!-- #comment-## -->
          </ol>
          <!-- .children -->
         </li>
         <!-- #comment-## -->
         <li class="comment odd alt thread-odd thread-alt depth-1 parent" id="comment-4333">
          <article class="comment-body" id="div-comment-4333">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/57436a6e4074d64612f2485c7daa8dcd?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              陈欢欢
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-4333">
              <time datetime="2013-06-05T01:48:03+00:00">
               2013/06/05 01:48
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             getColor=function(mapdata,provname,provcol,othercol)
             <br/>
             + {
             <br/>
             + f=function(x,z)
             <br/>
             + ifelse(x%in%z,which(z==x),0)
             <br/>
             + colIndex=sapply(mapdata@data$NAME,f,provname)
             <br/>
             + col=c(othercol,provcol)[colIndex+1]
             <br/>
             + return(col)
             <br/>
             + }
             <br/>
             &gt; provname=(“武汉市”)
             <br/>
             &gt; provcol=(“blue”)
             <br/>
             &gt; plot(x,col=getColor(x,provname,provcol,”white”))
             <br/>
             错误于colIndex + 1 : 二进列运算符中有非数值参数
             <br/>
             &gt; provname=c(“北京市”,”天津市”,”上海市”,”重庆市”);
             <br/>
             &gt; provcol=c(“red”,”green”,”yellow”,”purple”);
             <br/>
             &gt; plot(x,fg=getColor(x,provname,provcol,”white”));
             <br/>
             错误于colIndex + 1 : 二进列运算符中有非数值参数
             <br/>
             &gt;
             <br/>
             老师。这个错误是为什么呢？求解答。
             <br/>
             等待您的回复。
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给陈欢欢" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=4333#respond" onclick='return addComment.moveForm( "div-comment-4333", "4333", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
          <ol class="children">
           <li class="comment even depth-2" id="comment-4453">
            <article class="comment-body" id="div-comment-4453">
             <footer class="comment-meta">
              <div class="comment-author vcard">
               <img src="http://sdn.geekzu.org/avatar/078c951c0276bbedd3b777d6e3e6fee4?s=74&amp;d=monsterid&amp;r=g"/>
               <b class="fn">
                joey
               </b>
               <span class="says">
                说道：
               </span>
              </div>
              <!-- .comment-author -->
              <div class="comment-metadata">
               <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-4453">
                <time datetime="2013-06-27T10:26:47+00:00">
                 2013/06/27 10:26
                </time>
               </a>
              </div>
              <!-- .comment-metadata -->
             </footer>
             <!-- .comment-meta -->
             <div class="comment-content">
              <p>
               这个地图是用省边界绘制的，武汉市应该画不出来，网上有市边界的数据包。
               <br/>
               plot(x,fg=getColor(x,provname,provcol,”white”));
               <br/>
               应该是plot(x,col=getColor(x,provname,provcol,”white”))吧，fg改为col试试～
              </p>
             </div>
             <!-- .comment-content -->
             <div class="reply">
              <a aria-label="回复给joey" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=4453#respond" onclick='return addComment.moveForm( "div-comment-4453", "4453", "respond", "1335" )' rel="nofollow">
               回复
              </a>
             </div>
            </article>
            <!-- .comment-body -->
           </li>
           <!-- #comment-## -->
          </ol>
          <!-- .children -->
         </li>
         <!-- #comment-## -->
         <li class="comment odd alt thread-even depth-1 parent" id="comment-4487">
          <article class="comment-body" id="div-comment-4487">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/d8564b50b8742d1c7e1b3b256a58068e?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              yadandan
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-4487">
              <time datetime="2013-07-03T21:08:19+00:00">
               2013/07/03 21:08
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             这个中国地图能用ggplot2画吗？貌似x的对象类型很难转化成数据框
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给yadandan" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=4487#respond" onclick='return addComment.moveForm( "div-comment-4487", "4487", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
          <ol class="children">
           <li class="comment even depth-2" id="comment-4540">
            <article class="comment-body" id="div-comment-4540">
             <footer class="comment-meta">
              <div class="comment-author vcard">
               <img src="http://sdn.geekzu.org/avatar/d8564b50b8742d1c7e1b3b256a58068e?s=74&amp;d=monsterid&amp;r=g"/>
               <b class="fn">
                yadandan
               </b>
               <span class="says">
                说道：
               </span>
              </div>
              <!-- .comment-author -->
              <div class="comment-metadata">
               <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-4540">
                <time datetime="2013-07-23T22:59:29+00:00">
                 2013/07/23 22:59
                </time>
               </a>
              </div>
              <!-- .comment-metadata -->
             </footer>
             <!-- .comment-meta -->
             <div class="comment-content">
              <p>
               终于搞明白了，用fortify函数可以转化成数据框
              </p>
             </div>
             <!-- .comment-content -->
             <div class="reply">
              <a aria-label="回复给yadandan" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=4540#respond" onclick='return addComment.moveForm( "div-comment-4540", "4540", "respond", "1335" )' rel="nofollow">
               回复
              </a>
             </div>
            </article>
            <!-- .comment-body -->
           </li>
           <!-- #comment-## -->
          </ol>
          <!-- .children -->
         </li>
         <!-- #comment-## -->
         <li class="comment odd alt thread-odd thread-alt depth-1" id="comment-4650">
          <article class="comment-body" id="div-comment-4650">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/53a62f05d5e4082a49dfeb0d2ff0ada7?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              figo
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-4650">
              <time datetime="2013-08-16T10:56:44+00:00">
               2013/08/16 10:56
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             非常感谢这个共享。另外请教一个问题，如果我需要对省份除了填充颜色外，还要填充斜线（有些地方只能打印黑白色，颜色没法区分），那么要怎样做呢，期待您的回复。
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给figo" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=4650#respond" onclick='return addComment.moveForm( "div-comment-4650", "4650", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
         </li>
         <!-- #comment-## -->
         <li class="comment even thread-even depth-1" id="comment-4738">
          <article class="comment-body" id="div-comment-4738">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/b235ff62e6875d50803674eda171aa03?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              gkwang
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-4738">
              <time datetime="2013-08-29T11:00:55+00:00">
               2013/08/29 11:00
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             x=readShapePoly("bou2_4p.shp")
             <br/>
             错误: 没有"readShapePoly"这个函数
             <br/>
             求解答
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给gkwang" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=4738#respond" onclick='return addComment.moveForm( "div-comment-4738", "4738", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
         </li>
         <!-- #comment-## -->
         <li class="comment odd alt thread-odd thread-alt depth-1" id="comment-4739">
          <article class="comment-body" id="div-comment-4739">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/b235ff62e6875d50803674eda171aa03?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              gkwang
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-4739">
              <time datetime="2013-08-29T11:04:13+00:00">
               2013/08/29 11:04
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             x=readShapePoly("bou2_4p.shp")
             <br/>
             错误: 没有"readShapePoly"这个函数
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给gkwang" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=4739#respond" onclick='return addComment.moveForm( "div-comment-4739", "4739", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
         </li>
         <!-- #comment-## -->
         <li class="comment even thread-even depth-1" id="comment-4843">
          <article class="comment-body" id="div-comment-4843">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              我喜欢我选择
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-4843">
              <time datetime="2013-09-12T16:56:52+00:00">
               2013/09/12 16:56
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             Hi, 邱怡轩，我在linux环境下，打开x@data可以看到NAME列为乱码，所以给直辖市填充颜色时匹配肯定不成功，就更不能填充相应的颜色了。后来我到windows下测试，发现可以。想问问linux下怎样才能跑起来，主要是如何解决这个编码问题。
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给我喜欢我选择" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=4843#respond" onclick='return addComment.moveForm( "div-comment-4843", "4843", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
         </li>
         <!-- #comment-## -->
         <li class="pingback odd alt thread-odd thread-alt depth-1" id="comment-4985">
          <div class="comment-body">
           Pingback：
           <a class="url" href="http://donglei.name/2013/10/map-data-with-r/" rel="external nofollow">
            Map data with R | 用R处理地图信息 | Dong Lei's Blog
           </a>
          </div>
         </li>
         <!-- #comment-## -->
         <li class="comment even thread-even depth-1" id="comment-5220">
          <article class="comment-body" id="div-comment-5220">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              匿名
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-5220">
              <time datetime="2014-01-01T21:24:45+00:00">
               2014/01/01 21:24
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             大神，请问我用gpclib包时，发生了如下问题，该怎么办呢？
             <br/>
             load("C:\Program Files\R\CHN_adm1.RData")
             <br/>
             &gt; gpclibPermit()
             <br/>
             FALSE
             <br/>
             china.map &lt;- fortify(gadm,region=’ID_1′)
             <br/>
             错误: 不是所有的isTRUE(gpclibPermitStatus())都是TRUE
             <br/>
             vals &lt;- data.frame(id =unique(china.map$id),val=water)
             <br/>
             错误于unique(china.map$id) : 找不到对象’china.map’
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=5220#respond" onclick='return addComment.moveForm( "div-comment-5220", "5220", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
         </li>
         <!-- #comment-## -->
         <li class="comment odd alt thread-odd thread-alt depth-1 parent" id="comment-5228">
          <article class="comment-body" id="div-comment-5228">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/56a8be36c2c4e337b8d7595b5b63bf29?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              耰紫
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-5228">
              <time datetime="2014-01-03T12:35:51+00:00">
               2014/01/03 12:35
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             x = readShapePloy(‘bou2_4p.shp’)
             <br/>
             错误: 没有"readShapePloy"这个函数
            </p>
            <p>
             怎么解决呢？
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给耰紫" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=5228#respond" onclick='return addComment.moveForm( "div-comment-5228", "5228", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
          <ol class="children">
           <li class="comment byuser comment-author-yixuanq bypostauthor even depth-2" id="comment-5234">
            <article class="comment-body" id="div-comment-5234">
             <footer class="comment-meta">
              <div class="comment-author vcard">
               <img src="http://sdn.geekzu.org/avatar/f09663fd5fc04bad5e5b09daddb86fe6?s=74&amp;d=monsterid&amp;r=g"/>
               <b class="fn">
                <a class="url" href="http://yixuan.cos.name/cn" rel="external nofollow">
                 Yixuan
                </a>
               </b>
               <span class="says">
                说道：
               </span>
              </div>
              <!-- .comment-author -->
              <div class="comment-metadata">
               <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-5234">
                <time datetime="2014-01-05T02:23:04+00:00">
                 2014/01/05 02:23
                </time>
               </a>
              </div>
              <!-- .comment-metadata -->
             </footer>
             <!-- .comment-meta -->
             <div class="comment-content">
              <p>
               函数名打错了，readShapePoly。
              </p>
             </div>
             <!-- .comment-content -->
             <div class="reply">
              <a aria-label="回复给Yixuan" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=5234#respond" onclick='return addComment.moveForm( "div-comment-5234", "5234", "respond", "1335" )' rel="nofollow">
               回复
              </a>
             </div>
            </article>
            <!-- .comment-body -->
           </li>
           <!-- #comment-## -->
          </ol>
          <!-- .children -->
         </li>
         <!-- #comment-## -->
         <li class="comment odd alt thread-even depth-1" id="comment-5345">
          <article class="comment-body" id="div-comment-5345">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              weiyang-zhang
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-5345">
              <time datetime="2014-02-12T01:08:23+00:00">
               2014/02/12 01:08
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             city=readShapePoly(‘F:\gis\city.shp’)
             <br/>
             plot(city)
            </p>
            <p>
             &gt; getColor=function(mapdata,provname,provcol,othercol)
             <br/>
             {
             <br/>
             f=function(x,y) ifelse(x %in% y,which(y==x),0);
             <br/>
             colIndex=sapply(mapdata@data$NAME_2,f,provname);
             <br/>
             col=c(othercol,provcol)[colIndex+1];
             <br/>
             return(col);
             <br/>
             }
             <br/>
             provname=c("Jinghua","Ningbo")
             <br/>
             provcol=c("red","green")
             <br/>
             plot(x,col=getColor(x,provname,provcol,"white"))
             <br/>
             错误于colIndex + 1 : 二进列运算符中有非数值参数
             <br/>
             我把这个代码 改变后用在自己数据上  怎么出这个错误啊。。r代码小白  求指导
             <br/>
             我估摸着 是因为我的shp数据 属性是英文的，这个代码怎么改才能适合英文啊
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给weiyang-zhang" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=5345#respond" onclick='return addComment.moveForm( "div-comment-5345", "5345", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
         </li>
         <!-- #comment-## -->
         <li class="comment even thread-odd thread-alt depth-1 parent" id="comment-5346">
          <article class="comment-body" id="div-comment-5346">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              weiyang-zhang
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-5346">
              <time datetime="2014-02-12T01:10:23+00:00">
               2014/02/12 01:10
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             city=readShapePoly(‘F:\gis\city.shp’)
             <br/>
             plot(city)
            </p>
            <p>
             &gt; getColor=function(mapdata,provname,provcol,othercol)
             <br/>
             {
             <br/>
             f=function(x,y) ifelse(x %in% y,which(y==x),0);
             <br/>
             colIndex=sapply(mapdata@data$NAME_2,f,provname);
             <br/>
             col=c(othercol,provcol)[colIndex+1];
             <br/>
             return(col);
             <br/>
             }
             <br/>
             provname=c("Jinghua","Ningbo")
             <br/>
             provcol=c("red","green")
             <br/>
             plot(x,col=getColor(x,provname,provcol,"white"))
             <br/>
             错误于colIndex + 1 : 二进列运算符中有非数值参数
             <br/>
             我把这个代码 改变后用在自己数据上 怎么出这个错误啊。。r代码小白 求指导
             <br/>
             我估摸着 是因为我的shp数据 属性是英文的，这个代码怎么改才能适合英文啊， 求助啊  在线等。你改的那个英文解决了么  。。。ps 我懂shp  那是我们专业一种数据类型
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给weiyang-zhang" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=5346#respond" onclick='return addComment.moveForm( "div-comment-5346", "5346", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
          <ol class="children">
           <li class="comment byuser comment-author-yixuanq bypostauthor odd alt depth-2" id="comment-5348">
            <article class="comment-body" id="div-comment-5348">
             <footer class="comment-meta">
              <div class="comment-author vcard">
               <img src="http://sdn.geekzu.org/avatar/f09663fd5fc04bad5e5b09daddb86fe6?s=74&amp;d=monsterid&amp;r=g"/>
               <b class="fn">
                Yixuan
               </b>
               <span class="says">
                说道：
               </span>
              </div>
              <!-- .comment-author -->
              <div class="comment-metadata">
               <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-5348">
                <time datetime="2014-02-13T10:05:50+00:00">
                 2014/02/13 10:05
                </time>
               </a>
              </div>
              <!-- .comment-metadata -->
             </footer>
             <!-- .comment-meta -->
             <div class="comment-content">
              <p>
               这段代码只适用于当时的那个数据……你要不看下你的x@data$NAME_2是什么？当然也可能你的数据把城市名存储在了其他的地方。
              </p>
             </div>
             <!-- .comment-content -->
             <div class="reply">
              <a aria-label="回复给Yixuan" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=5348#respond" onclick='return addComment.moveForm( "div-comment-5348", "5348", "respond", "1335" )' rel="nofollow">
               回复
              </a>
             </div>
            </article>
            <!-- .comment-body -->
           </li>
           <!-- #comment-## -->
          </ol>
          <!-- .children -->
         </li>
         <!-- #comment-## -->
         <li class="comment even thread-even depth-1" id="comment-5405">
          <article class="comment-body" id="div-comment-5405">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/009da06515e1b50f128b588746d575d7?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              田蕊
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-5405">
              <time datetime="2014-03-04T20:16:25+00:00">
               2014/03/04 20:16
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             Hi Yixuan,
             <br/>
             我按照您的介绍输入，可是显示：
             <br/>
             package ‘maptools’ successfully unpacked and MD5 sums checked
             <br/>
             &gt; library(maptools)
             <br/>
             Error: package ‘sp’ required by ‘maptools’ could not be found
             <br/>
             &gt; plot(x,fg=gray(924:0/924));
             <br/>
             Error in plot(x, fg = gray(924:0/924)) : object ‘x’ not found
             <br/>
             试着重新从CRAN下载了maptools package，但是仍然没有“sp”。怎么解决呢？
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给田蕊" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=5405#respond" onclick='return addComment.moveForm( "div-comment-5405", "5405", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
         </li>
         <!-- #comment-## -->
         <li class="comment odd alt thread-odd thread-alt depth-1" id="comment-5406">
          <article class="comment-body" id="div-comment-5406">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/009da06515e1b50f128b588746d575d7?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              田蕊
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-5406">
              <time datetime="2014-03-04T20:22:22+00:00">
               2014/03/04 20:22
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             在划分重庆市和四川省的时候也是找不到“sp”：
             <br/>
             &gt; utils:::menuInstallLocal()
             <br/>
             package ‘maptools’ successfully unpacked and MD5 sums checked
             <br/>
             &gt;  library(maptools);
             <br/>
             Error: package ‘sp’ required by ‘maptools’ could not be found
             <br/>
             &gt; x=read.shapePoly(‘bou2_4p.shp’);
             <br/>
             Error: could not find function "read.shapePoly"
             <br/>
             &gt; plot(x);
             <br/>
             Error in plot(x) : object ‘x’ not found
             <br/>
             是不是maptools package又有变化？求助^^~
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给田蕊" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=5406#respond" onclick='return addComment.moveForm( "div-comment-5406", "5406", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
         </li>
         <!-- #comment-## -->
         <li class="comment even thread-even depth-1" id="comment-5456">
          <article class="comment-body" id="div-comment-5456">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/aaec788c77e376bca3641a7b7aad25e9?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              qingtian3721
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-5456">
              <time datetime="2014-03-18T11:46:51+00:00">
               2014/03/18 11:46
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             老师你好，这个数据画出来是一些破碎的线条，这是怎么回事啊
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给qingtian3721" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=5456#respond" onclick='return addComment.moveForm( "div-comment-5456", "5456", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
         </li>
         <!-- #comment-## -->
         <li class="pingback odd alt thread-odd thread-alt depth-1" id="comment-5492">
          <div class="comment-body">
           Pingback：
           <a class="url" href="http://openneuron.info/2014/03/31/%e4%b8%ad%e5%9b%bd%e7%bb%9f%e8%ae%a1%e5%b9%b4%e9%89%b4%e5%8f%af%e8%a7%86%e5%8c%96%ef%bc%882012%e5%b9%b4%e5%90%84%e7%9c%81%e5%8c%ba%e9%ab%98%e6%a0%a1%e4%ba%ba%e6%95%b0" rel="external nofollow">
            中国统计年鉴可视化（2012年各省区高校人数） - Open Thought
           </a>
          </div>
         </li>
         <!-- #comment-## -->
         <li class="pingback even thread-even depth-1" id="comment-5493">
          <div class="comment-body">
           Pingback：
           <a class="url" href="http://openneuron.info/2014/03/31/%e4%b8%ad%e5%9b%bd%e7%bb%9f%e8%ae%a1%e5%b9%b4%e9%89%b4%e5%8f%af%e8%a7%86%e5%8c%96%ef%bc%882012%e5%b9%b4%e5%90%84%e7%9c%81%e5%8c%ba%e9%ab%98%e6%a0%a1%e4%ba%ba%e6%95%b0" rel="external nofollow">
            中国统计年鉴可视化（2012年各省区人口和高校） - Open Thought
           </a>
          </div>
         </li>
         <!-- #comment-## -->
         <li class="comment odd alt thread-odd thread-alt depth-1" id="comment-5612">
          <article class="comment-body" id="div-comment-5612">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/92c2ee89fd0d86d960d7de5b5e83efff?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              nicolas
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-5612">
              <time datetime="2014-04-28T14:13:08+00:00">
               2014/04/28 14:13
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             levels(china.map$NAME) &lt;- iconv(levels(china.map$NAME),"gb2312","utf-8")转换编码
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给nicolas" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=5612#respond" onclick='return addComment.moveForm( "div-comment-5612", "5612", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
         </li>
         <!-- #comment-## -->
         <li class="comment even thread-even depth-1" id="comment-5622">
          <article class="comment-body" id="div-comment-5622">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/6e39d0d513d4c32e4ce2ba333620dc00?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              <a class="url" href="http://www.zhouleyu.com/life/skinny-essential-oils-work-again" rel="external nofollow">
               zhouleyu
              </a>
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-5622">
              <time datetime="2014-04-30T13:12:13+00:00">
               2014/04/30 13:12
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             导入GIS数据后，发现省名在R里显示是乱码，请问应该如何解决？
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给zhouleyu" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=5622#respond" onclick='return addComment.moveForm( "div-comment-5622", "5622", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
         </li>
         <!-- #comment-## -->
         <li class="comment odd alt thread-odd thread-alt depth-1 parent" id="comment-5641">
          <article class="comment-body" id="div-comment-5641">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              <a class="url" href="http://weibo.com/yue899889" rel="external nofollow">
               若翼惠
              </a>
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-5641">
              <time datetime="2014-05-02T08:51:46+00:00">
               2014/05/02 08:51
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             还是搞不定“乱码”的小伙伴看过来
             <br/>
             rm(list=ls())
             <br/>
             library(maptools)
             <br/>
             setwd("/Users/YUE/Documents/study/econ/2nd year/demo2/Empirical_Examples_/0415/china-province-border-data")
             <br/>
             x=readShapePoly("bou2_4p.shp")
             <br/>
             plot(x)
             <br/>
             as.character(na.omit(unique(x$NAME)))
             <br/>
             #################我是分割线#######################################
             <br/>
             ###这时候会输出一大堆数字########
            </p>
            <p>
             #   "351273221351276231346261237347234201"
             <br/>
             #   #”3452062053502222313452172443502072523462622733452142#72"
             <br/>
             #   #”3462262603472262063472732643452202763452602243502072#52346262273345214272"
             <br/>
             #   "345220211346236227347234201"
             <br/>
             #   "350276275345256201347234201"
             <br/>
             #   "347224230350202203347234201"
             <br/>
             #   "346262263345214227347234201"
             <br/>
             #   "345214227344272254345270202"
             <br/>
             #    "345261261350245277347234201"
             <br/>
             #[10] "345244251346264245345270202"
             <br/>
             #[11] "351231225350245277347234201"
             <br/>
             #[12] #”3452562013452442173452332363462272173502072523462622#73345214272"
             <br/>
             #[13] "351235222346265267347234201"
             <br/>
             #[14] "345261261344270234347234201"
             <br/>
             #[15] "350245277350227217350207252346262273345214272"
             <br/>
             #[16] "346262263345215227347234201"
             <br/>
             #[17] "346261237350213217347234201"
             <br/>
             #[18] "345256211345276275347234201"
             <br/>
             #[19] "345233233345267235347234201"
             <br/>
             #[20] "346271226345214227347234201"
             <br/>
             #[21] "351207215345272206345270202"
             <br/>
             #   "344270212346265267345270202"
             <br/>
             #[23] "346265231346261237347234201"
             <br/>
             #[24] "346271226345215227347234201"
             <br/>
             #[25] "346261237350245277347234201"
             <br/>
             #[26] "344272221345215227347234201"
             <br/>
             #[27] "350264265345267236347234201"
             <br/>
             #[28] "347246217345273272347234201"
             <br/>
             #[29] #”3452712773502452773452432563462272173502072523462622#73345214272"
             <br/>
             #[30] "345217260346271276347234201"
             <br/>
             #[31] "345271277344270234347234201"
             <br/>
             #[32] #”3512462313462702573472112713452102533502412143462242#77345214272"
             <br/>
             #[33] "346265267345215227347234201"
             <br/>
             ####之前参考一个修改乱码的办法调出了各省市的CODE，惊异地（笨拙地）发现原来数字和城市是一一对应的。先给出查看方法：
             <br/>
             ################分割线（此部分不影响主题代码可以越过）##########3
             <br/>
             levels&lt;-iconv(levels(x$NAME),"gb2312","utf-8”)#解决乱码使得其与中文一一对应#
             <br/>
             getColor=function(mapdata,provname,provcol,othercol){f=function(x,y) ifelse(x %in% y, which(y==x),0); colIndex=sapply(levels, to="UTF-8"),f,provname);col=c(othercol,provcol)[colIndex+1];return(col)}#重新定义getColor#
             <br/>
             provname=c("北京市","天津市","河北省","山西省","内蒙古自治区",
             <br/>
             "辽宁省","吉林省","黑龙江省","上海市","江苏省",
             <br/>
             "浙江省","安徽省","福建省","江西省","山东省",
             <br/>
             "河南省","湖北省","湖南省","广东省",
             <br/>
             "广西壮族自治区","海南省","重庆市","四川省","贵州省",
             <br/>
             "云南省","西藏自治区","陕西省","甘肃省","青海省",
             <br/>
             "宁夏回族自治区","新疆维吾尔自治区","台湾省",
             <br/>
             "香港特别行政区”)#查阅乱码对应的省市#
            </p>
            <p>
             #   "345214227344272254345270202"
             <br/>
             #    "345244251346264245345270202"
             <br/>
             #    "346262263345214227347234201"
             <br/>
             #    "345261261350245277347234201"
             <br/>
             #    #”3452062053502222313452172443502072523462622733
             <br/>
             #45214272"
             <br/>
             #    "350276275345256201347234201"
             <br/>
             #    "345220211346236227347234201"
             <br/>
             #    "351273221351276231346261237347234201"
             <br/>
             #    "344270212346265267345270202"
             <br/>
             #[10] "346261237350213217347234201"
             <br/>
             #[11] "346265231346261237347234201"
             <br/>
             #[12] "345256211345276275347234201"
             <br/>
             #[13] "347246217345273272347234201"
             <br/>
             #[14] "346261237350245277347234201"
             <br/>
             #[15] "345261261344270234347234201"
             <br/>
             #[16] "346262263345215227347234201"
             <br/>
             #[17] "346271226345214227347234201"
             <br/>
             #[18] "346271226345215227347234201"
             <br/>
             #[19] "345271277344270234347234201"
             <br/>
             #[20] #”3452712773502452773452432563462272173502072523#46262273345214272"
             <br/>
             #[21] "346265267345215227347234201"
             <br/>
             #   "351207215345272206345270202"
             <br/>
             #[23] "345233233345267235347234201"
             <br/>
             #[24] "350264265345267236347234201"
             <br/>
             #[25] "344272221345215227347234201"
             <br/>
             #[26] #”350245277350227217350207252346262273345214272"
             <br/>
             #[27] "351231225350245277347234201"
             <br/>
             #[28] "347224230350202203347234201"
             <br/>
             #[29] "351235222346265267347234201"
             <br/>
             #[30] #”3452562013452442173452332363462272173502072523#46262273345214272"
             <br/>
             #[31] #”3462262603472262063472732643452202763452602243#50207252346262273345214272"
             <br/>
             #[32] "345217260346271276347234201"
             <br/>
             #[33] #”3512462313462702573472112713452102533502412143#46224277345214272"#
             <br/>
             #######################分割线#############
             <br/>
             ###看出来，两组数字每组一个三位数代表一个汉字，比如234201代表省。#
             <br/>
             #########################################################
             <br/>
             ##然后我采用笨方法，还是把代码当成名字运行画图，举例##
             <br/>
             getColor=function(mapdata,provname,provcol,othercol){f=function(x,y) ifelse(x %in% y, which(y==x),0); colIndex=sapply(mapdata@data$NAME,f,provname);col=c(othercol,provcol)[colIndex+1];return(col);}
             <br/>
             provname=c("272243304317312241”)#海南省#
             <br/>
             provcol=c("red")
             <br/>
             plot(x,col=getColor(x,provname,provcol,"white"))
            </p>
            <p>
             #######被小乱码烦了一天终于在前辈牛人的各种语句下搞出了图，如果是MAC的同##学真的想转换拼音，可以下载QGIS，然后添加矢量图层，添加SHP文件，右键#####切换编辑状态修改NAME（跑题了）。最后还是特别感谢前辈的文件分享###
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给若翼惠" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=5641#respond" onclick='return addComment.moveForm( "div-comment-5641", "5641", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
          <ol class="children">
           <li class="comment even depth-2" id="comment-5642">
            <article class="comment-body" id="div-comment-5642">
             <footer class="comment-meta">
              <div class="comment-author vcard">
               <img src="http://sdn.geekzu.org/avatar/?s=74&amp;d=monsterid&amp;r=g"/>
               <b class="fn">
                <a class="url" href="http://weibo.com/yue899889" rel="external nofollow">
                 若翼惠
                </a>
               </b>
               <span class="says">
                说道：
               </span>
              </div>
              <!-- .comment-author -->
              <div class="comment-metadata">
               <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-5642">
                <time datetime="2014-05-02T12:54:22+00:00">
                 2014/05/02 12:54
                </time>
               </a>
              </div>
              <!-- .comment-metadata -->
             </footer>
             <!-- .comment-meta -->
             <div class="comment-content">
              <p>
               看出来，两组数字每组一个三位数代表一个汉字，比如234201代表省。
               <br/>
               这个地方有误，是三组数字每组一个三位数代表一个汉字，如347234201代表省
              </p>
             </div>
             <!-- .comment-content -->
             <div class="reply">
              <a aria-label="回复给若翼惠" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=5642#respond" onclick='return addComment.moveForm( "div-comment-5642", "5642", "respond", "1335" )' rel="nofollow">
               回复
              </a>
             </div>
            </article>
            <!-- .comment-body -->
           </li>
           <!-- #comment-## -->
           <li class="comment odd alt depth-2" id="comment-7028">
            <article class="comment-body" id="div-comment-7028">
             <footer class="comment-meta">
              <div class="comment-author vcard">
               <img src="http://sdn.geekzu.org/avatar/1b62b6094c371e0a2a3edb8c0a956e98?s=74&amp;d=monsterid&amp;r=g"/>
               <b class="fn">
                熊小呆
               </b>
               <span class="says">
                说道：
               </span>
              </div>
              <!-- .comment-author -->
              <div class="comment-metadata">
               <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-7028">
                <time datetime="2016-01-12T10:26:37+00:00">
                 2016/01/12 10:26
                </time>
               </a>
              </div>
              <!-- .comment-metadata -->
             </footer>
             <!-- .comment-meta -->
             <div class="comment-content">
              <p>
               ## 这样似乎更简便些
               <br/>
               levels&lt;-iconv(levels(x$NAME),"gb2312","utf-8")
               <br/>
               levels(x$NAME)&lt;-levels
              </p>
             </div>
             <!-- .comment-content -->
             <div class="reply">
              <a aria-label="回复给熊小呆" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=7028#respond" onclick='return addComment.moveForm( "div-comment-7028", "7028", "respond", "1335" )' rel="nofollow">
               回复
              </a>
             </div>
            </article>
            <!-- .comment-body -->
           </li>
           <!-- #comment-## -->
          </ol>
          <!-- .children -->
         </li>
         <!-- #comment-## -->
         <li class="comment even thread-even depth-1" id="comment-5661">
          <article class="comment-body" id="div-comment-5661">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              Z
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-5661">
              <time datetime="2014-05-05T01:06:32+00:00">
               2014/05/05 01:06
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             你好，我从gadm那下载了RData格式数据，用load("CHN_adm0.RData")导入，发现是空白的，能请教是什么问题吗？
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给Z" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=5661#respond" onclick='return addComment.moveForm( "div-comment-5661", "5661", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
         </li>
         <!-- #comment-## -->
         <li class="comment odd alt thread-odd thread-alt depth-1" id="comment-5662">
          <article class="comment-body" id="div-comment-5662">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              Z
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-5662">
              <time datetime="2014-05-05T01:09:19+00:00">
               2014/05/05 01:09
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             你好，我也遇到同样问题，想要把NAME项转化成英语，能具体说下怎么用 writePolyShpe()完成这一项吗？
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给Z" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=5662#respond" onclick='return addComment.moveForm( "div-comment-5662", "5662", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
         </li>
         <!-- #comment-## -->
         <li class="comment even thread-even depth-1" id="comment-5888">
          <article class="comment-body" id="div-comment-5888">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              <a class="url" href="http://t.qq.com/qizhaokunbeijing" rel="external nofollow">
               戚兆坤
              </a>
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-5888">
              <time datetime="2014-06-13T13:25:41+00:00">
               2014/06/13 13:25
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             R软件
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给戚兆坤" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=5888#respond" onclick='return addComment.moveForm( "div-comment-5888", "5888", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
         </li>
         <!-- #comment-## -->
         <li class="comment odd alt thread-odd thread-alt depth-1 parent" id="comment-6006">
          <article class="comment-body" id="div-comment-6006">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/318b547851bfe316d8ee44cac8a56171?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              LiPH
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-6006">
              <time datetime="2014-07-08T08:08:21+00:00">
               2014/07/08 08:08
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             还是有些Bug，待整理
             <br/>
             provname=c("北京市","天津市","上海市","重庆市");
             <br/>
             &gt; provcol=c("red","green","yellow","purple");
             <br/>
             &gt; plot(x,fg=getColor(x,provname,provcol,"white"));
             <br/>
             错误于plot.window(xlim = xlim, ylim = ylim, asp = asp, …) :
             <br/>
             图形参数"fg"的长度不对
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给LiPH" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=6006#respond" onclick='return addComment.moveForm( "div-comment-6006", "6006", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
          <ol class="children">
           <li class="comment even depth-2" id="comment-6479">
            <article class="comment-body" id="div-comment-6479">
             <footer class="comment-meta">
              <div class="comment-author vcard">
               <img src="http://sdn.geekzu.org/avatar/?s=74&amp;d=monsterid&amp;r=g"/>
               <b class="fn">
                <a class="url" href="http://weibo.com/2182853162" rel="external nofollow">
                 楽楽在上海
                </a>
               </b>
               <span class="says">
                说道：
               </span>
              </div>
              <!-- .comment-author -->
              <div class="comment-metadata">
               <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-6479">
                <time datetime="2014-12-27T21:34:46+00:00">
                 2014/12/27 21:34
                </time>
               </a>
              </div>
              <!-- .comment-metadata -->
             </footer>
             <!-- .comment-meta -->
             <div class="comment-content">
              <p>
               把参数名fg改为col就可以了
              </p>
             </div>
             <!-- .comment-content -->
             <div class="reply">
              <a aria-label="回复给楽楽在上海" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=6479#respond" onclick='return addComment.moveForm( "div-comment-6479", "6479", "respond", "1335" )' rel="nofollow">
               回复
              </a>
             </div>
            </article>
            <!-- .comment-body -->
           </li>
           <!-- #comment-## -->
          </ol>
          <!-- .children -->
         </li>
         <!-- #comment-## -->
         <li class="comment odd alt thread-even depth-1" id="comment-6121">
          <article class="comment-body" id="div-comment-6121">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              <a class="url" href="http://weibo.com/1838455212" rel="external nofollow">
               Sser_THK
              </a>
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-6121">
              <time datetime="2014-08-07T13:12:30+00:00">
               2014/08/07 13:12
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             老师您好，请问怎么可以在地图上面标注具体地名？
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给Sser_THK" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=6121#respond" onclick='return addComment.moveForm( "div-comment-6121", "6121", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
         </li>
         <!-- #comment-## -->
         <li class="comment even thread-odd thread-alt depth-1" id="comment-6131">
          <article class="comment-body" id="div-comment-6131">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              <a class="url" href="http://weibo.com/3218239603" rel="external nofollow">
               不了峰二世
              </a>
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-6131">
              <time datetime="2014-08-13T15:49:02+00:00">
               2014/08/13 15:49
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             在R 3.1.0版本实现上面的地图功能 (也就是修修改改一下
             <img src="http://static.duoshuo.com/images/smilies/icon_smile.gif"/>
             )
             <br/>
             附上代码,一路执行,畅通无阻
             <br/>
             <a href="http://f.dataguru.cn/forum.php?mod=viewthread&amp;tid=346958&amp;page=1&amp;extra=#pid1072178" rel="nofollow">
              http://f.dataguru.cn/forum.php?mod=viewthread&amp;tid=346958&amp;page=1&amp;extra=#pid1072178
             </a>
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给不了峰二世" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=6131#respond" onclick='return addComment.moveForm( "div-comment-6131", "6131", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
         </li>
         <!-- #comment-## -->
         <li class="pingback odd alt thread-even depth-1" id="comment-6142">
          <div class="comment-body">
           Pingback：
           <a class="url" href="http://cos.name/2014/08/r-maps-for-china/" rel="external nofollow">
            Editor: R绘制中国地图，并展示流行病学数据 | 统计之都 (中国统计学门户网站，免费统计学服务平台)
           </a>
          </div>
         </li>
         <!-- #comment-## -->
         <li class="pingback even thread-odd thread-alt depth-1" id="comment-6148">
          <div class="comment-body">
           Pingback：
           <a class="url" href="http://www.makaidong.com/41162.html" rel="external nofollow">
            R绘制中国地图，并展示流行病学数据 - 马开东博客
           </a>
          </div>
         </li>
         <!-- #comment-## -->
         <li class="pingback odd alt thread-even depth-1" id="comment-6189">
          <div class="comment-body">
           Pingback：
           <a class="url" href="http://dataunion.org/?p=878" rel="external nofollow">
            如何用R实现空间数据可视化 | 数盟
           </a>
          </div>
         </li>
         <!-- #comment-## -->
         <li class="comment even thread-odd thread-alt depth-1" id="comment-6295">
          <article class="comment-body" id="div-comment-6295">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              <a class="url" href="http://t.qq.com/wwwtlw1987" rel="external nofollow">
               tlw1987
              </a>
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-6295">
              <time datetime="2014-10-17T09:43:33+00:00">
               2014/10/17 09:43
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             请问R能不能把部分省市用斜杠，部分省市横线之类区分啊，意思就是不用颜色区分不同类别的省市，谢谢
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给tlw1987" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=6295#respond" onclick='return addComment.moveForm( "div-comment-6295", "6295", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
         </li>
         <!-- #comment-## -->
         <li class="comment odd alt thread-even depth-1" id="comment-6309">
          <article class="comment-body" id="div-comment-6309">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              <a class="url" href="http://weibo.com/1667338123" rel="external nofollow">
               爱法桐的狗
              </a>
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-6309">
              <time datetime="2014-10-24T12:14:08+00:00">
               2014/10/24 12:14
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             这个不重要
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给爱法桐的狗" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=6309#respond" onclick='return addComment.moveForm( "div-comment-6309", "6309", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
         </li>
         <!-- #comment-## -->
         <li class="comment even thread-odd thread-alt depth-1 parent" id="comment-6442">
          <article class="comment-body" id="div-comment-6442">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/61c6693fb0479a02a5301bcb19277c9a?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              Jackjie
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-6442">
              <time datetime="2014-12-10T14:52:29+00:00">
               2014/12/10 14:52
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             “首先，从这里下载中国地图的GIS数据，这是一个压缩包，完全解压后包含三个文件（bou2_4p.dbf、bou2_4p.shp和bou2_4p.shx），将这三个文件解压到同一个目录下，并在R中设好相应的工作空间，”我想问怎么算是在R中设好相应的工作空间啊？我在运行的时候出现“Error in getinfo.shape(filen) : Error opening SHP file”，是不是我把这三个文件解压的位置不对啊？谢谢
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给Jackjie" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=6442#respond" onclick='return addComment.moveForm( "div-comment-6442", "6442", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
          <ol class="children">
           <li class="comment odd alt depth-2" id="comment-6653">
            <article class="comment-body" id="div-comment-6653">
             <footer class="comment-meta">
              <div class="comment-author vcard">
               <img src="http://sdn.geekzu.org/avatar/34cc6e9b1c67aacb263546863a75292c?s=74&amp;d=monsterid&amp;r=g"/>
               <b class="fn">
                ThomasLee
               </b>
               <span class="says">
                说道：
               </span>
              </div>
              <!-- .comment-author -->
              <div class="comment-metadata">
               <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-6653">
                <time datetime="2015-04-06T18:01:26+00:00">
                 2015/04/06 18:01
                </time>
               </a>
              </div>
              <!-- .comment-metadata -->
             </footer>
             <!-- .comment-meta -->
             <div class="comment-content">
              <p>
               setwd(“E://bigdata/china-province-border-data/”);
              </p>
             </div>
             <!-- .comment-content -->
             <div class="reply">
              <a aria-label="回复给ThomasLee" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=6653#respond" onclick='return addComment.moveForm( "div-comment-6653", "6653", "respond", "1335" )' rel="nofollow">
               回复
              </a>
             </div>
            </article>
            <!-- .comment-body -->
           </li>
           <!-- #comment-## -->
          </ol>
          <!-- .children -->
         </li>
         <!-- #comment-## -->
         <li class="pingback even thread-even depth-1" id="comment-6470">
          <div class="comment-body">
           Pingback：
           <a class="url" href="http://www.imxun.cn/2014/12/23/319" rel="external nofollow">
            用R实现地图中标记骑行所经城市 | IMXUN
           </a>
          </div>
         </li>
         <!-- #comment-## -->
         <li class="comment odd alt thread-odd thread-alt depth-1" id="comment-6472">
          <article class="comment-body" id="div-comment-6472">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/10d8b4fd2668c81e813a682130fbcd55?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              laction
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-6472">
              <time datetime="2014-12-24T17:20:38+00:00">
               2014/12/24 17:20
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             为什么我做出来的图没有XY轴？
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给laction" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=6472#respond" onclick='return addComment.moveForm( "div-comment-6472", "6472", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
         </li>
         <!-- #comment-## -->
         <li class="comment even thread-even depth-1 parent" id="comment-6617">
          <article class="comment-body" id="div-comment-6617">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/bb94ff44cea7a2759718498b43fc3fd2?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              fengliwubi
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-6617">
              <time datetime="2015-03-06T15:10:31+00:00">
               2015/03/06 15:10
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             getColor=function(mapdata,provname,provcol,othercol)
             <br/>
             {
             <br/>
             f=function(x,y) ifelse(x %in% y,which(y==x),0);
             <br/>
             colIndex=sapply(mapdata@data$NAME,f,provname);
             <br/>
             col=c(othercol,provcol)[colIndex+1];
             <br/>
             return(col);
             <br/>
             }
            </p>
            <p>
             provname=c(“北京市”,”天津市”,”上海市”,”重庆市”);
             <br/>
             provcol=c(“red”,”green”,”yellow”,”purple”);
             <br/>
             plot(x,col=getColor(x,provname,provcol,”white”));
            </p>
            <p>
             为什么按照这个命令运行，结果四个直辖市的颜色显示不出来呢？
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给fengliwubi" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=6617#respond" onclick='return addComment.moveForm( "div-comment-6617", "6617", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
          <ol class="children">
           <li class="comment odd alt depth-2 parent" id="comment-6682">
            <article class="comment-body" id="div-comment-6682">
             <footer class="comment-meta">
              <div class="comment-author vcard">
               <img src="http://sdn.geekzu.org/avatar/24244524eb62164d66d685d1062a43c6?s=74&amp;d=monsterid&amp;r=g"/>
               <b class="fn">
                nickcarter
               </b>
               <span class="says">
                说道：
               </span>
              </div>
              <!-- .comment-author -->
              <div class="comment-metadata">
               <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-6682">
                <time datetime="2015-04-23T07:54:17+00:00">
                 2015/04/23 07:54
                </time>
               </a>
              </div>
              <!-- .comment-metadata -->
             </footer>
             <!-- .comment-meta -->
             <div class="comment-content">
              <p>
               fengliwubi,
               <br/>
               你好，我和你运行的code一样，结果四个直辖市的颜色也是显示不出来，不知道是什么原因，你后来解决了吗？
              </p>
             </div>
             <!-- .comment-content -->
             <div class="reply">
              <a aria-label="回复给nickcarter" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=6682#respond" onclick='return addComment.moveForm( "div-comment-6682", "6682", "respond", "1335" )' rel="nofollow">
               回复
              </a>
             </div>
            </article>
            <!-- .comment-body -->
            <ol class="children">
             <li class="comment even depth-3" id="comment-7106">
              <article class="comment-body" id="div-comment-7106">
               <footer class="comment-meta">
                <div class="comment-author vcard">
                 <img src="http://sdn.geekzu.org/avatar/a4512787a83223810bfb7b997a842f91?s=74&amp;d=monsterid&amp;r=g"/>
                 <b class="fn">
                  JulyZhang
                 </b>
                 <span class="says">
                  说道：
                 </span>
                </div>
                <!-- .comment-author -->
                <div class="comment-metadata">
                 <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-7106">
                  <time datetime="2016-03-17T13:08:43+00:00">
                   2016/03/17 13:08
                  </time>
                 </a>
                </div>
                <!-- .comment-metadata -->
               </footer>
               <!-- .comment-meta -->
               <div class="comment-content">
                <p>
                 我解决了，应该是数据的编码问题，你输入的“北京市”“上海市”等省市信息和mapdata中的省市信息编码不一致，所以你getColor函数返回的全部都是white
                </p>
               </div>
               <!-- .comment-content -->
              </article>
              <!-- .comment-body -->
             </li>
             <!-- #comment-## -->
            </ol>
            <!-- .children -->
           </li>
           <!-- #comment-## -->
          </ol>
          <!-- .children -->
         </li>
         <!-- #comment-## -->
         <li class="comment odd alt thread-odd thread-alt depth-1" id="comment-6685">
          <article class="comment-body" id="div-comment-6685">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/1213ed24c7fd83dae11e72ffbbce7b79?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              栾先国
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-6685">
              <time datetime="2015-04-23T20:38:02+00:00">
               2015/04/23 20:38
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             请问，如何添加坐标轴和图例
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给栾先国" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=6685#respond" onclick='return addComment.moveForm( "div-comment-6685", "6685", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
         </li>
         <!-- #comment-## -->
         <li class="comment even thread-even depth-1" id="comment-6718">
          <article class="comment-body" id="div-comment-6718">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/e7c36a2309d20792bfc743998853dcbc?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              welly
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-6718">
              <time datetime="2015-05-29T21:20:54+00:00">
               2015/05/29 21:20
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             @fengliwubi  @nickcarter
            </p>
            <p>
             同样的问题，没有报错也没有显示颜色
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给welly" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=6718#respond" onclick='return addComment.moveForm( "div-comment-6718", "6718", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
         </li>
         <!-- #comment-## -->
         <li class="comment odd alt thread-odd thread-alt depth-1 parent" id="comment-6873">
          <article class="comment-body" id="div-comment-6873">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/7ec3b85c0af20430410b9a351d57df1b?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              Sarah
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-6873">
              <time datetime="2015-09-23T17:13:34+00:00">
               2015/09/23 17:13
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             我也是，用的老师提供的完全一样的代码，但是显示不出颜色
            </p>
            <p>
             getColor=function(mapdata,provname,provcol,othercol)
             <br/>
             {
             <br/>
             f=function(x,y) ifelse(x %in% y,which(y==x),0);
             <br/>
             colIndex=sapply(mapdata@data$NAME,f,provname);
             <br/>
             col=c(othercol,provcol)[colIndex+1];
             <br/>
             return(col);
             <br/>
             }
            </p>
            <p>
             provname=c(“北京市”,”12″,”上海市”,”重庆市”);
             <br/>
             provcol=c(“red”,”green”,”yellow”,”purple”);
             <br/>
             plot(x,col=getColor(x,provname,provcol,”white”));
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给Sarah" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=6873#respond" onclick='return addComment.moveForm( "div-comment-6873", "6873", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
          <ol class="children">
           <li class="comment even depth-2" id="comment-7114">
            <article class="comment-body" id="div-comment-7114">
             <footer class="comment-meta">
              <div class="comment-author vcard">
               <img src="http://sdn.geekzu.org/avatar/81c67037a5478541d38a903d816676ce?s=74&amp;d=monsterid&amp;r=g"/>
               <b class="fn">
                Leon
               </b>
               <span class="says">
                说道：
               </span>
              </div>
              <!-- .comment-author -->
              <div class="comment-metadata">
               <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-7114">
                <time datetime="2016-03-21T12:19:44+00:00">
                 2016/03/21 12:19
                </time>
               </a>
              </div>
              <!-- .comment-metadata -->
             </footer>
             <!-- .comment-meta -->
             <div class="comment-content">
              <p>
               我遇到了同样的问题，x@data$NAME显示的是乱码，发现是系统使用了英文的，导致R默认英文，不识别省份汉字，修改下默认语言就好了。
              </p>
             </div>
             <!-- .comment-content -->
             <div class="reply">
              <a aria-label="回复给Leon" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=7114#respond" onclick='return addComment.moveForm( "div-comment-7114", "7114", "respond", "1335" )' rel="nofollow">
               回复
              </a>
             </div>
            </article>
            <!-- .comment-body -->
           </li>
           <!-- #comment-## -->
          </ol>
          <!-- .children -->
         </li>
         <!-- #comment-## -->
         <li class="comment odd alt thread-even depth-1" id="comment-6937">
          <article class="comment-body" id="div-comment-6937">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/c6cf5ee4712cc455bf26351ed421ecab?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              edfall
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-6937">
              <time datetime="2015-11-15T14:21:30+00:00">
               2015/11/15 14:21
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             好多函数或者对象的属性都变啦，这篇文章是不是该更新一下…不然新手完全画不出来
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给edfall" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=6937#respond" onclick='return addComment.moveForm( "div-comment-6937", "6937", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
         </li>
         <!-- #comment-## -->
         <li class="comment even thread-odd thread-alt depth-1" id="comment-6952">
          <article class="comment-body" id="div-comment-6952">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/9d88720d930301d9825db6d92cda1e43?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              Kate
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-6952">
              <time datetime="2015-11-23T13:11:40+00:00">
               2015/11/23 13:11
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             大感谢。。但画中国的人这么多，有没有更完善一点的package呢？每次都要从外部加载GIS再读成图，好麻烦。。。
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给Kate" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=6952#respond" onclick='return addComment.moveForm( "div-comment-6952", "6952", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
         </li>
         <!-- #comment-## -->
         <li class="comment odd alt thread-even depth-1" id="comment-6982">
          <article class="comment-body" id="div-comment-6982">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/4ad7febbf6a4c44440a2b1bd26fe45b8?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              妖孽么么
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-6982">
              <time datetime="2015-12-09T11:35:52+00:00">
               2015/12/09 11:35
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             那个数据包好像不能用了，
             <br/>
             错误: 復原文件幻数出错(文件可能有损坏)– 没有载入任何数据
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给妖孽么么" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=6982#respond" onclick='return addComment.moveForm( "div-comment-6982", "6982", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
         </li>
         <!-- #comment-## -->
         <li class="comment even thread-odd thread-alt depth-1" id="comment-7033">
          <article class="comment-body" id="div-comment-7033">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/3e998d3c32dfc718f9df416ff22225ab?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              Susan
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-7033">
              <time datetime="2016-01-15T09:35:59+00:00">
               2016/01/15 09:35
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             刚学习R的新手，想问一下，如果想画中国地图，可以通过选择不同的图例，在地图上显示图例对应的省份， 这种动态的图如何实现？求解
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给Susan" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=7033#respond" onclick='return addComment.moveForm( "div-comment-7033", "7033", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
         </li>
         <!-- #comment-## -->
         <li class="pingback odd alt thread-even depth-1" id="comment-7035">
          <div class="comment-body">
           Pingback：
           <a class="url" href="http://www.dashujukong.com/zixun/6733" rel="external nofollow">
            如何用R实现空间数据可视化-大数据控
           </a>
          </div>
         </li>
         <!-- #comment-## -->
         <li class="comment even thread-odd thread-alt depth-1" id="comment-7118">
          <article class="comment-body" id="div-comment-7118">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/442c3cfa7c64ac70d7ff220b5bb9e4f3?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              张
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2009/07/drawing-china-map-using-r/#comment-7118">
              <time datetime="2016-03-24T09:30:21+00:00">
               2016/03/24 09:30
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             你好，想要请教以下如果在下载的底图中，其中一个城市的一条边界时缺失的，应该如何修正呢？期待您的回复。
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给张" class="comment-reply-link" href="http://cos.name/2009/07/drawing-china-map-using-r/?replytocom=7118#respond" onclick='return addComment.moveForm( "div-comment-7118", "7118", "respond", "1335" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
         </li>
         <!-- #comment-## -->
        </ol>
        <!-- .comment-list -->
        <div class="comment-respond" id="respond">
         <h3 class="comment-reply-title" id="reply-title">
          发表评论
          <small>
           <a href="http://cos.name/2009/07/drawing-china-map-using-r/#respond" id="cancel-comment-reply-link" rel="nofollow" style="display:none;">
            取消回复
           </a>
          </small>
         </h3>
         <form action="http://cos.name/wp-comments-post.php" class="comment-form" id="commentform" method="post" novalidate="">
          <p class="comment-notes">
           <span id="email-notes">
            电子邮件地址不会被公开。
           </span>
           必填项已用
           <span class="required">
            *
           </span>
           标注
          </p>
          <p class="comment-form-comment">
           <label for="comment">
            评论
           </label>
           <textarea aria-required="true" cols="45" id="comment" maxlength="65525" name="comment" required="required" rows="8">
           </textarea>
          </p>
          <p class="comment-form-author">
           <label for="author">
            姓名
            <span class="required">
             *
            </span>
           </label>
          </p>
          <p class="comment-form-email">
           <label for="email">
            电子邮件
            <span class="required">
             *
            </span>
           </label>
          </p>
          <p class="comment-form-url">
           <label for="url">
            站点
           </label>
          </p>
          <p class="form-submit">
          </p>
          <p style="display: none;">
          </p>
          <p style="display: none;">
          </p>
         </form>
        </div>
        <!-- #respond -->
       </div>
       <!-- #comments -->
      </div>
      <!-- #content -->
     </div>
     <!-- #primary -->
     <div class="sidebar-container" id="tertiary" role="complementary">
      <div class="sidebar-inner">
       <div class="widget-area">
        <aside class="widget widget_text" id="text-3">
         <h3 class="widget-title">
          关注统计之都
         </h3>
         <div class="textwidget">
          <ul>
           <li>
            新浪微博
            <a href="http://weibo.com/cosname">
             @统计之都
            </a>
           </li>
           <li>
            人人网
            <a href="http://renren.com/cosname">
             @统计之都
            </a>
           </li>
           <li>
            Twitter
            <a href="http://twitter.com/cos_name">
             @cos_name
            </a>
           </li>
          </ul>
         </div>
        </aside>
        <aside class="widget widget_text" id="text-6">
         <h3 class="widget-title">
          微信公众平台
         </h3>
         <div class="textwidget">
          <img src="http://cos.name/wp-content/uploads/2013/04/qrcode-8cm.jpg"/>
          <p style="font-size:12px;margin-left:15px">
           微信号 CapStat
          </p>
          <p>
           我们将第一时间向您推送主站和论坛的精彩内容，以及统计之都的线下活动、竞赛、培训和会议信息。
          </p>
         </div>
        </aside>
        <aside class="widget widget_text" id="text-8">
         <h3 class="widget-title">
          站内导航
         </h3>
         <div class="textwidget">
          <ul>
           <li class="page_item">
            <a href="http://cos.name/cn/">
             中文论坛
            </a>
           </li>
           <li class="page_item">
            <a href="http://cos.name/videos/">
             视频
            </a>
           </li>
           <li class="page_item">
            <a href="http://cos.name/salon/">
             统计沙龙
            </a>
           </li>
           <li class="page_item">
            <a href="http://cos.name/books/">
             图书出版
            </a>
           </li>
           <li class="page_item">
            <a href="http://cos.name/training/">
             教育培训
            </a>
           </li>
           <li class="page_item">
            <a href="http://cos.name/about/">
             关于我们
            </a>
           </li>
           <li class="page_item">
            <a href="http://cos.name/donate/">
             捐赠
            </a>
           </li>
           <li class="page_item">
            <a href="http://cos.name/chinar/">
             R语言会议
            </a>
           </li>
          </ul>
         </div>
        </aside>
        <aside class="widget widget_links" id="linkcat-2">
         <h3 class="widget-title">
          友情链接
         </h3>
         <ul class="xoxo blogroll">
          <li>
           <a href="http://stat.ruc.edu.cn" target="_blank" title="中国人民大学统计学院网站">
            中国人民大学统计学院
           </a>
          </li>
          <li>
           <a href="http://rucdmc.net">
            中国人民大学数据挖掘中心
           </a>
          </li>
          <li>
           <a href="http://birc.gsm.pku.edu.cn/" target="_blank">
            北京大学商务智能研究中心
           </a>
          </li>
          <li>
           <a href="http://sam.cufe.edu.cn/" target="_blank" title="中央财经大学统计与数学学院网站">
            中央财经大学统计与数学学院
           </a>
          </li>
          <li>
           <a href="http://tjx.cueb.edu.cn/" target="_blank" title="首都经济贸易大学统计学院网站">
            首经贸统计学院
           </a>
          </li>
          <li>
           <a href="http://www.shookr.com/">
            数客网大数据社区
           </a>
          </li>
          <li>
           <a href="http://www.xueqing.tv/" target="_blank" title="数据科学在线学习平台">
            雪晴数据网
           </a>
          </li>
          <li>
           <a href="http://iera.name/" target="_blank" title="IERA是一个旨在普及、传播和增进工业工程知识的非营利性网站">
            IERA（直通IE）
           </a>
          </li>
         </ul>
        </aside>
        <aside class="widget widget_categories" id="categories-2">
         <h3 class="widget-title">
          全部分类
         </h3>
         <label class="screen-reader-text" for="cat">
          全部分类
         </label>
         <select class="postform" id="cat" name="cat">
          <option value="-1">
           选择分类目录
          </option>
          <option class="level-0" value="925">
           cos访谈  (4)
          </option>
          <option class="level-0" value="659">
           图书出版  (5)
          </option>
          <option class="level-0" value="379">
           数学方法  (14)
          </option>
          <option class="level-1" value="381">
           分析与代数  (1)
          </option>
          <option class="level-1" value="380">
           概率论  (9)
          </option>
          <option class="level-1" value="382">
           随机过程  (5)
          </option>
          <option class="level-0" value="210">
           数据分析  (81)
          </option>
          <option class="level-1" value="203">
           多元统计  (3)
          </option>
          <option class="level-1" value="42">
           数据挖掘与机器学习  (42)
          </option>
          <option class="level-1" value="36">
           生物与医学统计  (17)
          </option>
          <option class="level-1" value="35">
           计量经济学  (4)
          </option>
          <option class="level-1" value="296">
           金融统计  (3)
          </option>
          <option class="level-1" value="303">
           风险精算  (7)
          </option>
          <option class="level-0" value="177">
           模型专题  (15)
          </option>
          <option class="level-1" value="38">
           回归分析  (10)
          </option>
          <option class="level-1" value="41">
           时间序列  (2)
          </option>
          <option class="level-0" value="784">
           每周精选  (24)
          </option>
          <option class="level-1" value="183">
           可视化  (9)
          </option>
          <option class="level-0" value="967">
           沙龙纪要  (3)
          </option>
          <option class="level-0" value="18">
           经典理论  (46)
          </option>
          <option class="level-1" value="37">
           抽样调查  (3)
          </option>
          <option class="level-1" value="4">
           统计推断  (26)
          </option>
          <option class="level-1" value="236">
           试验设计  (7)
          </option>
          <option class="level-1" value="39">
           非参数统计  (3)
          </option>
          <option class="level-0" value="1">
           统计之都  (279)
          </option>
          <option class="level-1" value="884">
           中国R会议  (2)
          </option>
          <option class="level-1" value="885">
           中国R语言会议  (5)
          </option>
          <option class="level-1" value="446">
           出国留学  (3)
          </option>
          <option class="level-1" value="179">
           推荐文章  (90)
          </option>
          <option class="level-1" value="3">
           新闻通知  (75)
          </option>
          <option class="level-1" value="263">
           统计刊物  (10)
          </option>
          <option class="level-1" value="174">
           网站导读  (40)
          </option>
          <option class="level-1" value="204">
           职业事业  (51)
          </option>
          <option class="level-1" value="213">
           高校课堂  (9)
          </option>
          <option class="level-0" value="178">
           统计计算  (28)
          </option>
          <option class="level-1" value="40">
           优化与模拟  (15)
          </option>
          <option class="level-1" value="43">
           贝叶斯方法  (6)
          </option>
          <option class="level-0" value="378">
           软件应用  (116)
          </option>
          <option class="level-1" value="44">
           统计图形  (36)
          </option>
          <option class="level-1" value="110">
           统计软件  (83)
          </option>
         </select>
        </aside>
        <aside class="widget widget_recent_comments" id="recent-comments-2">
         <h3 class="widget-title">
          最新评论
         </h3>
         <ul id="recentcomments">
          <li class="recentcomments">
           <span class="comment-author-link">
            fineboom
           </span>
           发表在《
           <a href="http://cos.name/2016/06/use-shiny-fleetly-set-up-visual-prototype-system/#comment-7317">
            利用shiny包快速搭建可视化原型系统
           </a>
           》
          </li>
          <li class="recentcomments">
           <span class="comment-author-link">
            胡家新
           </span>
           发表在《
           <a href="http://cos.name/2016/06/r%e8%af%ad%e5%8d%83%e5%af%bb%e7%ac%ac%e4%b8%89%e6%9c%9f%ef%bc%9a%e5%bc%a0%e6%97%a0%e5%bf%8c%e7%a9%b6%e7%ab%9f%e7%88%b1%e8%b0%81%ef%bc%9f/#comment-7316">
            R语千寻第三期：张无忌究竟爱谁？
           </a>
           》
          </li>
          <li class="recentcomments">
           <span class="comment-author-link">
            <a class="url" href="http://www.zijiacha.com/category.php?id=6" rel="external nofollow">
             南糯山普洱茶
            </a>
           </span>
           发表在《
           <a href="http://cos.name/2016/06/r%e8%af%ad%e5%8d%83%e5%af%bb%e7%ac%ac%e4%b8%89%e6%9c%9f%ef%bc%9a%e5%bc%a0%e6%97%a0%e5%bf%8c%e7%a9%b6%e7%ab%9f%e7%88%b1%e8%b0%81%ef%bc%9f/#comment-7315">
            R语千寻第三期：张无忌究竟爱谁？
           </a>
           》
          </li>
          <li class="recentcomments">
           <span class="comment-author-link">
            J
           </span>
           发表在《
           <a href="http://cos.name/2016/05/value-of-the-reputation-from-the-data/#comment-7314">
            数据告诉你：高信誉的卖家应该收高价，还是收低价？
           </a>
           》
          </li>
          <li class="recentcomments">
           <span class="comment-author-link">
            <a class="url" href="http://gg" rel="external nofollow">
             Hilda
            </a>
           </span>
           发表在《
           <a href="http://cos.name/2013/01/drawing-map-in-r-era/#comment-7311">
            R时代，你要怎样画地图？
           </a>
           》
          </li>
         </ul>
        </aside>
        <aside class="widget widget_rss" id="rss-282869971">
         <h3 class="widget-title">
          <a class="rsswidget" href="http://cos.name/cn/topics/feed/">
           <img src="http://cos.name/wp-includes/images/rss.png"/>
          </a>
          <a class="rsswidget" href="http://cos.name/cn/topics/feed/">
           中文论坛新帖
          </a>
         </h3>
         <ul>
          <li>
           <a class="rsswidget" href="http://cos.name/cn/topic/417372/">
            处理时间数据和产生时间序列的问题
           </a>
          </li>
          <li>
           <a class="rsswidget" href="http://cos.name/cn/topic/6790/">
            《统计陷阱》下载 （How to lie with statistics）
           </a>
          </li>
          <li>
           <a class="rsswidget" href="http://cos.name/cn/topic/818/">
            统计学的世界（第五版）
           </a>
          </li>
          <li>
           <a class="rsswidget" href="http://cos.name/cn/topic/16574/">
            class(x) 返回值值是AsIs,AsIs代表什么，有什么用处？
           </a>
          </li>
          <li>
           <a class="rsswidget" href="http://cos.name/cn/topic/417366/">
            如何用R绘制一个分类算法的决策规则
           </a>
          </li>
         </ul>
        </aside>
        <aside class="widget widget_text" id="text-2">
         <h3 class="widget-title">
          登录/RSS
         </h3>
         <div class="textwidget">
          <ul>
           <li>
            <a href="http://cos.name/wp-admin/">
             登录
            </a>
           </li>
           <li>
            <a href="http://cos.name/feed/" title="使用 RSS 2.0 同步站点内容">
             文章
             <abbr title="Really Simple Syndication">
              RSS
             </abbr>
            </a>
           </li>
           <li>
            <a href="http://cos.name/comments/feed/" title="RSS 上的最近评论">
             评论
             <abbr title="Really Simple Syndication">
              RSS
             </abbr>
            </a>
           </li>
          </ul>
         </div>
        </aside>
       </div>
       <!-- .widget-area -->
      </div>
      <!-- .sidebar-inner -->
     </div>
     <!-- #tertiary -->
    </div>
    <!-- #main -->
    <footer class="site-footer" id="colophon" role="contentinfo">
     <div class="site-info">
      版权所有 © 2014 统计之都 | 由
      <a href="http://wordpress.org/">
       WordPress
      </a>
      构建 | 主题修改自
      <a href="http://wordpress.org/themes/twentythirteen">
       Twenty Thirteen
      </a>
     </div>
     <!-- .site-info -->
    </footer>
    <!-- #colophon -->
   </div>
   <!-- #page -->
   <p style="margin:0;padding:0;height:1px;overflow:hidden;">
    <a href="http://www.wumii.com/widget/relatedItems" style="border:0;">
     <img src="http://static.wumii.cn/images/pixel.png"/>
    </a>
   </p>
  </div>
 </body>
</html>